Here you can find the source of formatPercentage(int enumerator, int denominator)
public static String formatPercentage(int enumerator, int denominator)
//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); } }