Java Money Format formatOfRead(BigDecimal money)

Here you can find the source of formatOfRead(BigDecimal money)

Description

format Of Read

License

Apache License

Parameter

Parameter Description
money a parameter

Declaration

public static String formatOfRead(BigDecimal money) 

Method Source Code


//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);
    }
}

Related

  1. formatMoney(Object str)
  2. formatMoney(String money)
  3. formatMoneyNoSymbol(int pennies)
  4. formatMoneyShort(int pennies)
  5. formatMoneyVI(String money)
  6. formatThousandMoney(String moneyStr)
  7. getMoneyFormat(double money)
  8. getMoneyString(double money)
  9. hourAndMinutesToString(int hours, int minutes)