Here you can find the source of formatPercent(long divisor, long dividend)
public static String formatPercent(long divisor, long dividend)
//package com.java2s; import java.util.Locale; public class Main { public static String formatPercent(long divisor, long dividend) { if (dividend == 0) { return null; }/*from w ww .j ava 2 s .c om*/ double ret = (double) (divisor * 100) / dividend; return String.format(Locale.CHINA, "%.2f%%", ret); } }