Class LocalizedNumberFormatter

    • Method Detail

      • format

        public FormattedNumber format​(long input)
        Format the given byte, short, int, or long to a string using the settings specified in the NumberFormatter fluent setting chain.
        Parameters:
        input - The number to format.
        Returns:
        A FormattedNumber object; call .toString() to get the string.
        See Also:
        NumberFormatter
      • format

        public FormattedNumber format​(double input)
        Format the given float or double to a string using the settings specified in the NumberFormatter fluent setting chain.
        Parameters:
        input - The number to format.
        Returns:
        A FormattedNumber object; call .toString() to get the string.
        See Also:
        NumberFormatter
      • format

        public FormattedNumber format​(java.lang.Number input)
        Format the given BigInteger, BigDecimal, or other Number to a string using the settings specified in the NumberFormatter fluent setting chain.
        Parameters:
        input - The number to format.
        Returns:
        A FormattedNumber object; call .toString() to get the string.
        See Also:
        NumberFormatter
      • format

        public FormattedNumber format​(Measure input)
        Format the given Measure or CurrencyAmount to a string using the settings specified in the NumberFormatter fluent setting chain.

        The unit specified here overrides any unit that may have been specified in the setter chain. This method is intended for cases when each input to the number formatter has a different unit.

        Parameters:
        input - The number to format.
        Returns:
        A FormattedNumber object; call .toString() to get the string.
        See Also:
        NumberFormatter
      • format

        @Deprecated
        public FormattedNumber format​(com.ibm.icu.impl.number.DecimalQuantity fq)
        Deprecated.
        ICU 60 This API is ICU internal only.
        This is the core entrypoint to the number formatting pipeline. It performs self-regulation: a static code path for the first few calls, and compiling a more efficient data structure if called repeatedly.

        This function is very hot, being called in every call to the number formatting pipeline.

        Parameters:
        fq - The quantity to be formatted.
        Returns:
        The formatted number result.