Java BigDecimal Round round(BigDecimal aValue, int aScale)

Here you can find the source of round(BigDecimal aValue, int aScale)

Description

round

License

Open Source License

Declaration

public static BigDecimal round(BigDecimal aValue, int aScale) 

Method Source Code


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

public class Main {

    public static BigDecimal round(BigDecimal aValue, int aScale) {
        if (aValue == null)
            return null;

        aValue = aValue.setScale(aScale, BigDecimal.ROUND_HALF_UP);

        return aValue;
    }/*from  w w  w .  ja  v  a  2 s . c o m*/
}

Related

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