Here you can find the source of percentFormat(Object object)
public static String percentFormat(Object object)
//package com.java2s; //License from project: Apache License import java.text.NumberFormat; public class Main { public static String percentFormat(Object object) { if (object == null) { return ""; }//w w w . ja v a 2 s . com NumberFormat percent = NumberFormat.getPercentInstance(); percent.setMaximumFractionDigits(2); return percent.format(object); } }