Java BigDecimal Format formate(BigDecimal amount)

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

Description

formate

License

Open Source License

Declaration

public static String formate(BigDecimal amount) 

Method Source Code


//package com.java2s;
import java.math.BigDecimal;

public class Main {

    public static String formate(BigDecimal amount) {
        if (amount == null) {
            return "0.00";
        }//from w w w  . j  ava 2 s .  c om
        return amount.setScale(2, BigDecimal.ROUND_HALF_UP).toString();
    }
}

Related

  1. formatDouble(Double someDouble, int digitsToTheRightOfDecimal)
  2. formatDouble(Double toFormat)
  3. formatDouble(double value, int decimalPlaces)
  4. formatDoubleNumber(double f)
  5. formatDoubleValue(int medianAfterTheDecimalPoint, String doubleStringValue)
  6. formatFAAssertRatioWithoutPercent(BigDecimal value)
  7. formatFileSize(double size)
  8. formatFloat0(String value, int n)
  9. formatForPercentage(BigDecimal value)