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