Java Percentage Format formatPercentage(int enumerator, int denominator)

Here you can find the source of formatPercentage(int enumerator, int denominator)

Description

format Percentage

License

Open Source License

Declaration

public static String formatPercentage(int enumerator, int denominator) 

Method Source Code


//package com.java2s;
/*/*  w w w .j  a v a 2s  . c o m*/
 * See the file "LICENSE" for the full license governing this code.
 */

import java.text.NumberFormat;
import java.util.Locale;

public class Main {
    private static final NumberFormat PERCENT_FORMAT = NumberFormat.getPercentInstance(Locale.US);

    public static String formatPercentage(int enumerator, int denominator) {
        return PERCENT_FORMAT.format((double) enumerator / (double) denominator);
    }
}

Related

  1. formatPercent1dp(double frac)
  2. formatPercentage(double perc)
  3. formatPercentage(Double percentage)
  4. formatPercentage(double percentage)
  5. formatPercentage(double percentage)
  6. formatTimePercent(long part, long tot)
  7. getIntRoundPercent(double f)
  8. getOneDecimalPercentFromDouble(double inValue)
  9. getPercentage(double number)