Java Fraction Format formatAmount(Double amount)

Here you can find the source of formatAmount(Double amount)

Description

format Amount

License

Apache License

Declaration

public static String formatAmount(Double amount) 

Method Source Code


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

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

public class Main {
    public static String formatAmount(Double amount) {
        return String.format("%.2f", amount);
    }/*from   ww w. j a v a2  s .com*/

    public static String formatAmount(BigDecimal amount) {
        return new DecimalFormat("#0.00").format(amount);
    }
}

Related

  1. format(float value)
  2. format(NumberFormat nf, float number, float defaultValue)
  3. format0(Double d)
  4. format2Double(Double amount)
  5. formatAmount(double amount)
  6. formatAmount(double number)
  7. formatAmount(final double mark)
  8. formatAnotherString(double valor)
  9. formataNum(double numero)