Format Number
Formats numbers, currencies, etc
Description
Provides language-sensitive number formatting. Formats a number as decimals, currencies, etc. according to a locale and a set of options. The implementation is based on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat" target="_blank">Intl.NumberFormat</a>.
Inputs
- n (Number): The number to format
- locales (String): A locale (
en-US
,ch-FR
, ...), or a list of locales (["de-DE", "de-AT", "fr-FR"]
). If empty, uses the default locale of the user. See <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument" target="_blank">here</a> for the full documentation. - format (Format Number Formats): The format to use. Compact means e.g. 34M, 120K. Definitions are <a href="#item=019155a2767fc076a99c" target="blank">here</a>.
- customization (String): Additional customization added on top of
format
. Possible options are documented as per <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options" target="_blank">Intl.NumberFormat</a>.
Provide as a JSON, e.g." { "style": "unit", "unit": "liter" }.
Outputs
- formatted number (String): The number formatted according to the given format.