private static int writeDecimal(long value, int digitCnt, int e10, char[] buf, int off) {
        if ((value & 1) == 0 && value % 5 == 0) {
            while (value % 100 == 0) {
                digitCnt -= 2;
                value /= 100;
                if (digitCnt == 1) {
                    break;
                }
            }
            if ((value & 1) == 0 && value % 5 == 0) {
                if (value > 0) {
                    --digitCnt;
                    value /= 10;
                }
            }
        }
        // whether to use scientific notation
        boolean useScientific = e10 < -3 || e10 >= 7; // !((e10 >= -3) && (e10 < 7));
        if (useScientific) {
            if (digitCnt == 1) {
                buf[off] = (char) (value + 48);
                IOUtils.putIntUnaligned(buf, off + 1, DOT_ZERO_32);
                off += 3;
            } else {
                int pos = digitCnt - 2;
                // get the first digit
                long tl = POW10_LONG_VALUES[pos];
                int fd = (int) (value / tl);
                buf[off] = (char) (fd + 48);
                buf[off + 1] = '.';
                off += 2;

                long pointAfter = value - fd * tl;
                // fill zeros
                while (--pos > -1 && pointAfter < POW10_LONG_VALUES[pos]) {
                    buf[off++] = '0';
                }
                off = IOUtils.writeInt64(buf, off, pointAfter);
            }
            buf[off++] = 'E';
            if (e10 < 0) {
                buf[off++] = '-';
                e10 = -e10;
            }
            if (e10 > 99) {
                int n = (int) (e10 * 1374389535L >> 37); //
                buf[off] = (char) (n + 48);
                e10 = e10 - n * 100;
                IOUtils.putIntUnaligned(buf, off + 1, TWO_DIGITS_32_BITS[e10]);
                off += 3;
            } else {
                if (e10 > 9) {
                    IOUtils.putIntUnaligned(buf, off, TWO_DIGITS_32_BITS[e10]);
                    off += 2;
                } else {
                    buf[off++] = (char) (e10 + 48);
                }
            }
        } else {
            // for non-scientific notation such as 12345, write a decimal point when size = decimalExp.
            if (e10 < 0) {
                // -1/-2/-3
                IOUtils.putIntUnaligned(buf, off, ZERO_DOT_32); // 0.
                off += 2;
                if (e10 == -2) {
                    buf[off++] = '0';
                } else if (e10 == -3) {
                    IOUtils.putIntUnaligned(buf, off, ZERO_ZERO_32); // 00
                    off += 2;
                }
                off = writeInt64(buf, off, value);
            } else {
                // 0 - 6
                int decimalPointPos = (digitCnt - 1) - e10;
                if (decimalPointPos > 0) {
                    int pos = decimalPointPos - 1;
                    long tl = POW10_LONG_VALUES[pos];
                    int pointBefore = (int) (value / tl);
                    off = writeInt64(buf, off, pointBefore);
                    buf[off++] = '.';
                    long pointAfter = value - pointBefore * tl;
                    // fill zeros
                    while (--pos > -1 && pointAfter < POW10_LONG_VALUES[pos]) {
                        buf[off++] = '0';
                    }
                    off = writeInt64(buf, off, pointAfter);
                } else {
                    off = writeInt64(buf, off, value);
                    int zeroCnt = -decimalPointPos;
                    if (zeroCnt > 0) {
                        for (int i = 0; i < zeroCnt; ++i) {
                            buf[off++] = '0';
                        }
                    }
                    IOUtils.putIntUnaligned(buf, off, DOT_ZERO_32); // .0
                    off += 2;
                }
            }
        }

        return off;
    }
Conversion of ieee floating point numbers to Scientific notation

<p> Using the difference estimation method </p>
<p> The output may not be the shortest, but the general result is correct </p>

@param doubleValue &gt; 0
core/src/main/java/com/alibaba/fastjson2/util/NumberUtils.java