Express Sweet API Reference - v3.0.0
    Preparing search index...
    • Returns the language-sensitive representation of a number as a string.

      Parameters

      • val: string | number

        Target number or numeric string.

      • Optionallocales: string

        A string with a BCP 47 language tag, or an array of such strings. Corresponds to the locales parameter of the Intl.NumberFormat() constructor. In implementations without Intl.NumberFormat support, this parameter is ignored and the host's locale is usually used.

      Returns string

      A string with a language-sensitive representation of the given number.

      {{!-- results in: 123,456.789 --}}
      {{number2locale 123456.789}}

      {{!-- German uses comma as decimal separator and period for thousands. --}}
      {{!-- results in: 123.456,789 --}}
      {{number2locale 123456.789 'de-DE'}}