Interface FormatLocaleObject

A Format Locale Object

interface FormatLocaleObject {
    format(specifier): ((n) => string);
    formatPrefix(specifier, value): ((n) => string);
}

Methods

  • Returns a new format function for the given string specifier. The returned function takes a number as the only argument, and returns a string representing the formatted number.

    Parameters

    • specifier: string

      A Specifier string.

    Returns ((n) => string)

      • (n): string
      • Returns a new format function for the given string specifier. The returned function takes a number as the only argument, and returns a string representing the formatted number.

        Parameters

        • n: number | {
              valueOf(): number;
          }

        Returns string

        Throws

        Error on invalid format specifier.

    Throws

    Error on invalid format specifier.

  • Returns a new format function for the given string specifier. The returned function takes a number as the only argument, and returns a string representing the formatted number. The returned function will convert values to the units of the appropriate SI prefix for the specified numeric reference value before formatting in fixed point notation.

    Parameters

    • specifier: string

      A Specifier string.

    • value: number

      The reference value to determine the appropriate SI prefix.

    Returns ((n) => string)

      • (n): string
      • Returns a new format function for the given string specifier. The returned function takes a number as the only argument, and returns a string representing the formatted number. The returned function will convert values to the units of the appropriate SI prefix for the specified numeric reference value before formatting in fixed point notation.

        Parameters

        • n: number | {
              valueOf(): number;
          }

        Returns string

        Throws

        Error on invalid format specifier.

    Throws

    Error on invalid format specifier.