Here you can find the source of percentage(Double v, String postfix)
public static String percentage(Double v, String postfix)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static String percentage(Double v, String postfix) { return new DecimalFormat("0.00").format(100. * v) + postfix; }// ww w.ja va 2 s.c o m public static String percentage(Double v) { return percentage(v, "%"); } }