Java tutorial
//package com.java2s; import java.math.BigDecimal; import java.text.DecimalFormat; public class Main { public static String formatPercent(BigDecimal number) { String result = "0"; if (number != null) { number = number.multiply(new BigDecimal("100")); DecimalFormat formatter = new DecimalFormat(); formatter.setMaximumFractionDigits(2); } return result; } }