private static void formatTimestampMillis(StringBuilder buf, int time, int precision) {
    // we copy this method from Calcite DateTimeUtils but add the following changes
    // time may be negative which means time milli seconds before 00:00:00
    // this maybe a bug in calcite avatica
    while (time < 0) {
      time += MILLIS_PER_DAY;
    }
    int h = time / 3600000;
    int time2 = time % 3600000;
    int m = time2 / 60000;
    int time3 = time2 % 60000;
    int s = time3 / 1000;
    int ms = time3 % 1000;
    int2(buf, h);
    buf.append(':');
    int2(buf, m);
    buf.append(':');
    int2(buf, s);
    if (precision > 0) {
      buf.append('.');
      while (precision > 0) {
        buf.append((char) ('0' + (ms / 100)));
        ms = ms % 100;
        ms = ms * 10;

        // keep consistent with Timestamp.toString()
        if (ms == 0) {
          break;
        }

        --precision;
      }
    }
  }
Parses a fraction, multiplying the first character by {@code multiplier}, the second character
by {@code multiplier / 10}, the third character by {@code multiplier / 100}, and so forth.

<p>For example, {@code parseFraction("1234", 100)} yields {@code 123}.
amoro-format-mixed/amoro-mixed-flink/amoro-mixed-flink-common/src/main/java/org/apache/amoro/flink/util/DateTimeUtils.java