private static String formatTimestamp(TimestampData ts, int precision) {
    LocalDateTime ldt = ts.toLocalDateTime();

    String fraction = pad(9, ldt.getNano());
    while (fraction.length() > precision && fraction.endsWith("0")) {
      fraction = fraction.substring(0, fraction.length() - 1);
    }

    StringBuilder ymdhms =
        ymdhms(
            new StringBuilder(),
            ldt.getYear(),
            ldt.getMonthValue(),
            ldt.getDayOfMonth(),
            ldt.getHour(),
            ldt.getMinute(),
            ldt.getSecond());

    if (fraction.length() > 0) {
      ymdhms.append(".").append(fraction);
    }

    return ymdhms.toString();
  }
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