List of utility methods to do Percentage Format
String | formatPercent(double v) format Percent return new DecimalFormat("#.####%").format(v); |
String | formatPercent(final long value, final long total) format Percent return formatPercent((double) value / total); |
String | formatPercent(float p_num) Generate percentage value according with the special number float tmpF = (float) (((float) ((int) Math.floor(p_num * 100)) / 100)); Locale en = new Locale("en"); DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(en); df.applyPattern("0.00"); return df.format(tmpF); |
String | formatPercent1dp(double frac) Format a fraction as a percentage to 1 decimal place. return formatterPercent1dp.format(frac);
|
String | formatPercentage(double perc) Format as a percentage return percentFormatter.format(perc);
|
String | formatPercentage(Double percentage) Formats a Double representing a percentage into a string if (percentage == null) return ""; return formatPercentage(percentage.doubleValue()); |
String | formatPercentage(double percentage) Formats a numeric percentage, as a decimal number with at most 2 digits. return formatNumber(percentage) + "%"; |
String | formatPercentage(double percentage) format Percentage if (percentageFormatter == null) { percentageFormatter = new DecimalFormat("#0.0%"); return percentageFormatter.format(percentage); |
String | formatPercentage(int enumerator, int denominator) format Percentage return PERCENT_FORMAT.format((double) enumerator / (double) denominator); |
String | formatTimePercent(long part, long tot) format Time Percent final double timeRatio = (((double) part) / tot); String timePercent = new DecimalFormat("##.##%").format(timeRatio); return timePercent; |