public static int formatDecimal64()

in gflog-core/src/main/java/com/epam/deltix/gflog/core/util/Formatting.java [1580:1618]


    public static int formatDecimal64(final boolean sign,
                                      final int exponent,
                                      final @Nonnegative long significand,
                                      final @Nonnull MutableBuffer buffer,
                                      @Nonnegative int offset) {
        // Preconditions:
        // assert exponent >= DECIMAL_64_EXPONENT_MIN_VALUE && exponent <= DECIMAL_64_EXPONENT_MAX_VALUE;
        // assert significand > 0 && significand <= DECIMAL_64_SIGNIFICAND_MAX_VALUE;
        // assert array != null;
        // assert offset >= 0;

        if (sign) {
            offset = formatByte(MINUS, buffer, offset);
        }

        if (exponent >= 0) {
            offset = formatULong(significand, buffer, offset);
            offset = formatZeros(exponent, buffer, offset);
        } else if (exponent > -DECIMAL_64_SIGNIFICAND_MAX_DIGITS) {
            final int fractionLength = -exponent;
            final long multiplier = multiplierOfULong(fractionLength);

            final long integer = significand / multiplier;
            final long fraction = significand - integer * multiplier;

            offset = formatULong(integer, buffer, offset);

            if (fraction > 0) {
                offset = formatByte(DOT, buffer, offset);
                offset = formatFraction(fraction, fractionLength, buffer, offset);
            }
        } else {
            offset = formatZeroWithDot(buffer, offset);
            offset = formatZeros(-exponent - DECIMAL_64_SIGNIFICAND_MAX_DIGITS, buffer, offset);
            offset = formatFraction(significand, DECIMAL_64_SIGNIFICAND_MAX_DIGITS, buffer, offset);
        }

        return offset;
    }