Java Currency Format formatAsCurrency(Number value)

Here you can find the source of formatAsCurrency(Number value)

Description

format As Currency

License

Apache License

Declaration

public static String formatAsCurrency(Number value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;

import java.util.Locale;

public class Main {
    private static final DecimalFormat currencyFormat = new DecimalFormat("###,###,##0.00",
            DecimalFormatSymbols.getInstance(Locale.GERMANY));

    public static String formatAsCurrency(Number value) {
        if (value == null) {
            return "";
        }//from w w  w . j  a va  2 s  .c om
        return currencyFormat.format(value);
    }
}

Related

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