Here you can find the source of getPercentageString(double percent)
public static String getPercentageString(double percent)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; public class Main { private static DecimalFormat df = new DecimalFormat("##.##"); public static String getPercentageString(double percent) { return df.format(percent * 100f) + "%"; }/* ww w . jav a2 s .c o m*/ }