Java Money Format formatMoney(BigDecimal bd)

Here you can find the source of formatMoney(BigDecimal bd)

Description

format Money

License

Open Source License

Declaration

public static String formatMoney(BigDecimal bd) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

import java.math.RoundingMode;

import java.text.NumberFormat;

import java.util.*;

public class Main {
    public static String formatMoney(BigDecimal bd) {
        NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.US);
        nf.setRoundingMode(RoundingMode.HALF_EVEN);
        return nf.format(bd.setScale(2, RoundingMode.HALF_EVEN));
    }/*from  w w  w .  j a  v  a2  s.  c  om*/
}

Related

  1. beautifyMoney(long money)
  2. format(Object money)
  3. format2Money(double value)
  4. formatBookkeeperMoney(double cents, Locale locale)
  5. formatDoubleToMoneyString(double num)
  6. formatMoney(BigDecimal money, Locale locale)
  7. formatMoney(BigDecimal value)
  8. formatMoney(double cents, Locale locale)
  9. formatMoney(double dtSource)