- newScale
- scale of the result returned.
- roundingMode
- rounding mode to be used to round the result.
Documentation for this section has not yet been entered.
Type Reason Java.Lang.NullPointerException if roundingMode == null. Java.Lang.ArithmeticException if roundingMode == ROUND_UNNECESSARY and rounding is necessary according to the given scale.
Returns a new BigDecimal instance with the specified scale.
If the new scale is greater than the old scale, then additional zeros are added to the unscaled value. In this case no rounding is necessary.
If the new scale is smaller than the old scale, then trailing digits are removed. If these trailing digits are not zero, then the remaining unscaled value has to be rounded. For this rounding operation the specified rounding mode is used.