Here you can find the source of getPercent(Double num)
public static String getPercent(Double num)
//package com.java2s; import java.text.DecimalFormat; public class Main { public static String getPercent(Double num) { DecimalFormat df = new DecimalFormat("############0.00"); String rtNum = df.format(num * 100); return rtNum + "%"; }/*ww w . j a va 2s .c o m*/ }