Here you can find the source of percentFormat(BigDecimal interestRate)
public static String percentFormat(BigDecimal interestRate)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { private static NumberFormat percentFormat = new DecimalFormat("##.##"); public static String percentFormat(BigDecimal interestRate) { if (interestRate == null) return null; return percentFormat.format(interestRate.doubleValue() * 100) + "%"; }/*from w w w . j ava 2s.c om*/ }