private static BigInteger doBigIntegerScaleDown(BigInteger unscaledValue, int scaleDown) {
    BigInteger[] quotientAndRemainder = unscaledValue.divideAndRemainder(BigInteger.TEN.pow(scaleDown));
    BigInteger quotient = quotientAndRemainder[0];
    BigInteger round = quotientAndRemainder[1].divide(BigInteger.TEN.pow(scaleDown - 1));
    if (round.compareTo(BIG_INTEGER_FIVE) >= 0) {
      quotient = quotient.add(BigInteger.ONE);
    }
    return quotient;
  }
Scale down a BigInteger by a power of 10 and round off if necessary using ROUND_HALF_UP.
@return The scaled and rounded BigInteger.
storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java