Java Currency Format formatCurrency(BigDecimal amount)

Here you can find the source of formatCurrency(BigDecimal amount)

Description

format Currency

License

Open Source License

Declaration

public static String formatCurrency(BigDecimal amount) 

Method Source Code


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

import java.math.BigDecimal;
import java.text.DecimalFormat;

public class Main {

    public static String formatCurrency(BigDecimal amount) {
        if (amount.compareTo(BigDecimal.ZERO) <= 0) {
            return "0";
        }/*from   w w  w.  j a va2s. co  m*/
        DecimalFormat df = new DecimalFormat("#,###.00");
        return df.format(amount);
    }
}

Related

  1. format2CurrencyWithComma(double amt)
  2. formatAsCurrency(BigDecimal nAmount)
  3. formatAsCurrency(final double value)
  4. formatAsCurrency(Number amount)
  5. formatAsCurrency(Number value)
  6. formatCurrency(BigDecimal bd)
  7. formatCurrency(double amount)
  8. formatCurrency(double amount, int precision, Locale locale)
  9. formatCurrency(double amt)