Here you can find the source of formatPercent1dp(double frac)
public static String formatPercent1dp(double frac)
//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); } }