Java examples for java.math:BigDecimal Format
BigDecimal to Rmb Lower format
import java.math.BigDecimal; import java.text.DecimalFormat; public class Main{ private static final String RMB_LOWER_PATTERN = "?###,###.00"; public static String toRmbLower(BigDecimal value) { return NumberFormatUtil.format(value, RMB_LOWER_PATTERN); }/* w w w . jav a2 s . co m*/ public static String format(BigDecimal value, String pattern) { if (value == null) { return ""; } DecimalFormat df = new DecimalFormat(pattern); return df.format(value); } }