public void zeroFractionPart(UnsignedInt128 scratch) {
    short placesToRemove = this.getScale();

    // If there's no fraction part, return immediately to avoid the cost of a divide.
    if (placesToRemove == 0) {
      return;
    }

    /* Divide by a power of 10 equal to 10**scale to logically shift the digits
     * places right by "scale" positions to eliminate them.
     */
    UnsignedInt128 powerTenDivisor = SqlMathUtil.POWER_TENS_INT128[placesToRemove];

    this.getUnscaledValue().divideDestructive(powerTenDivisor, scratch);

    /* Multiply by the same power of ten to shift the decimal point back to
     * the original place. Places to the right of the decimal will be zero.
     */
    this.getUnscaledValue().scaleUpTenDestructive(placesToRemove);

    if (this.unscaledValue.isZero()) {
      this.signum = 0;
    }
  }
Zero the fractional part of value.

Argument scratch is needed to hold unused remainder output, to avoid need to
create a new object.
common/src/java/org/apache/hadoop/hive/common/type/Decimal128.java