Here you can find the source of formatOfRead(BigDecimal money)
Parameter | Description |
---|---|
money | a parameter |
public static String formatOfRead(BigDecimal money)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; import java.math.RoundingMode; import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { /**/*w w w.j a v a 2s. c o m*/ * @param money * @return */ public static String formatOfRead(BigDecimal money) { DecimalFormat format = new DecimalFormat("###,##0.00"); format.setRoundingMode(RoundingMode.HALF_UP); return format.format(money); } public static String format(BigDecimal money) { NumberFormat format = DecimalFormat.getInstance(); return format.format(money); } }