Java Currency Format formatCurrency(double amount)

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

Description

format Currency

License

Apache License

Declaration

public static String formatCurrency(double amount) 

Method Source Code


//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.text.DecimalFormat;
import java.text.NumberFormat;

public class Main {
    private static final NumberFormat cashAmount = new DecimalFormat("$#,##0.00");

    public static String formatCurrency(double amount) {
        return cashAmount.format(amount);
    }/*from   w  w w  .  ja  v  a 2  s .co m*/
}

Related

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