Java BigDecimal Round round(BigDecimal amount)

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

Description

round

License

Open Source License

Declaration

public static BigDecimal round(BigDecimal amount) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.math.BigDecimal;

import java.math.RoundingMode;

public class Main {
    public static BigDecimal round(BigDecimal amount) {
        if (amount != null) {
            return amount.setScale(2, RoundingMode.HALF_UP);
        } else {// w  w  w  . j a v a  2 s.  co m
            return null;
        }
    }
}

Related

  1. getRoundedAmt(BigDecimal amtBeforeRnd)
  2. getRoundedBigDecimal(double value)
  3. getRoundedBigDecimal(double value, int scale)
  4. getStringValue(BigDecimal val, int newScale, int roundingMode)
  5. magicRound(BigDecimal value)
  6. round(BigDecimal aValue, int aScale)
  7. round(BigDecimal b, int precision)
  8. round(BigDecimal d, int decimalDigits, RoundingMode rmode)
  9. round(BigDecimal d, int decimalPlace)