public BigDecimal roundBigDecimal ( final BigDecimal number ) { int mscale = getMathScale ( ) ; if ( mscale >= 0 ) { return number . setScale ( mscale , getMathContext ( ) . getRoundingMode ( ) ) ; } else { return number ; } }
Ensure a big decimal is rounded by this arithmetic scale and rounding mode .