@HiveDecimalVersionV2
  public int toFormatBytes(
      int formatScale,
      byte[] scratchBuffer) {
    return
        fastToFormatBytes(
            formatScale,
            scratchBuffer);
  }
This is the serialization version of decimal to string conversion.
<p>
It adds trailing zeroes when the formatScale is greater than the current scale.  Or, it
does round if the formatScale is less than the current scale.
<p>
Note that you can get more than 38 (MAX_PRECISION) digits in the output with this method.
storage-api/src/java/org/apache/hadoop/hive/common/type/HiveDecimal.java