Class DoubleFormat.MixedDoubleFormat

  • All Implemented Interfaces:
    java.util.function.DoubleFunction<java.lang.String>, ParsedDecimal.FormatOptions
    Enclosing class:
    DoubleFormat

    private static final class DoubleFormat.MixedDoubleFormat
    extends DoubleFormat.AbstractDoubleFormat
    Format class producing results similar to Double.toString(), with plain decimal notation for small numbers relatively close to zero and scientific notation otherwise.
    • Field Detail

      • plainMaxExponent

        private final int plainMaxExponent
        Max decimal exponent for plain format.
      • plainMinExponent

        private final int plainMinExponent
        Min decimal exponent for plain format.
    • Constructor Detail

      • MixedDoubleFormat

        MixedDoubleFormat​(DoubleFormat.Builder builder)
        Constructs a new instance.
        Parameters:
        builder - builder instance containing configuration values
    • Method Detail

      • applyFiniteInternal

        protected java.lang.String applyFiniteInternal​(ParsedDecimal val)
        Returns a formatted representation of the given rounded decimal value to dst.
        Specified by:
        applyFiniteInternal in class DoubleFormat.AbstractDoubleFormat
        Parameters:
        val - value to format
        Returns:
        a formatted representation of the given rounded decimal value to dst.