Java Percentage Format formatPercent1dp(double frac)

Here you can find the source of formatPercent1dp(double frac)

Description

Format a fraction as a percentage to 1 decimal place.

License

Open Source License

Declaration

public static String formatPercent1dp(double frac) 

Method Source Code

//package com.java2s;
//   it under the terms of the GNU General Public License as published by

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

import java.util.Locale;

public class Main {
    private static DecimalFormat formatterPercent1dp = new DecimalFormat(
            "#0.0%", DecimalFormatSymbols.getInstance(Locale.UK));

    /**/* www.j a  va  2  s.com*/
     * Format a fraction as a percentage to 1 decimal place.
     */
    public static String formatPercent1dp(double frac) {
        return formatterPercent1dp.format(frac);
    }
}

Related

  1. formatPercent(double percent)
  2. formatPercent(double v)
  3. formatPercent(double v)
  4. formatPercent(final long value, final long total)
  5. formatPercent(float p_num)
  6. formatPercentage(double perc)
  7. formatPercentage(Double percentage)
  8. formatPercentage(double percentage)
  9. formatPercentage(double percentage)