Java BigDecimal Format formatAmount(BigDecimal amount)

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

Description

format Amount

License

Apache License

Declaration

public static String formatAmount(BigDecimal 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.ja  va 2 s .c o  m

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

Related

  1. format(String pattern, final double secondInDouble)
  2. format2Scale(BigDecimal obj)
  3. format2String(BigDecimal bd)
  4. format_BigDecimal(BigDecimal decimal, Integer scale)
  5. formatAmount(BigDecimal amount)
  6. formatAmount(final BigDecimal number)
  7. formatAsReadable(BigDecimal number)
  8. formatBetrag(BigDecimal bdBetrag, Locale locale)
  9. formatBigDecimal(BigDecimal bd, NumberFormat format)