Here you can find the source of percentFormat(final BigDecimal bd)
Parameter | Description |
---|---|
bd | a parameter |
public static String percentFormat(final BigDecimal bd)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.text.NumberFormat; public class Main { private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(); /**/* www . j ava 2 s. co m*/ * return a Number formatted or empty string if null. * * @param bd */ public static String percentFormat(final BigDecimal bd) { return bd != null ? NUMBER_FORMAT.format(bd.movePointRight(2)) : ""; } /** * return a Number formatted or empty string if null. * * @param bd */ public static String format(final BigDecimal bd) { return bd != null ? NUMBER_FORMAT.format(bd) : ""; } }