NumberFormatter Op

NumberFormatter

Format a number to a string in the given locale and format


<p>Wrapped standard Javascript function toLocaleString.</p> <p>Outputs a formated representation of the input number, can work with currencies, use the browser locale or use a custom one. Numbers will be rounded to </p> <p>See doc here: <a href="https://www.w3schools.com/jsref/jsref_tolocalestring_number.asp">https://www.w3schools.com/jsref/jsref_tolocalestring_number.asp</a></p>


Full Name
  • Ops.String.NumberFormatter
Visibility
  • Core Op - Official cables op
License
  • MIT
AuthorgithubCompatibility


INPUT PORTS


Input Number (Number)
Locale index (Number:

<i>integer</i>

)
 browser  custom 
Locale string (String)

<p>A string with a BCP 47 language tag</p>

Style index (Number:

<i>integer</i>

)
 decimal  currency  percent 

<p>The formatting style to use</p>

Format

Minimum Integer Digits (Number:

<i>integer</i>

)

<p>The minimum number of integer digits to use. Possible values are from 1 to 21</p>

Minimum Fraction Digits (Number:

<i>integer</i>

)

<p>The minimum number of fraction digits to use. Possible values are from 0 to 20</p>

Maximum Fraction Digits (Number:

<i>integer</i>

)

<p>The maximum number of fraction digits to use. Possible values are from 0 to 20</p>

Significant Digits

Minimum Significant Digits (Number:

<i>integer</i>

)

<p>The maximum number of significant digits to use. Possible values are from 1 to 21</p>

Maximum Significant Digits (Number:

<i>integer</i>

)

<p>The minimum number of significant digits to use. Possible values are from 1 to 21</p>

Use Grouping (Number:

<i>boolean</i>

)

<p>Whether to use grouping separators, such as thousands separators.</p>

Currency

Currency Name (String)

<p>The currency to use in currency formatting. Possible values are the ISO 4217 currency codes.</p>

Currency Display index (Number:

<i>integer</i>

)
 symbol  code  name 

<p>How to display the currency in currency formatting</p>

OUTPUT PORTS


Formatted Number (String)
Has error (

<i>boolean</i>

Number)


Patches using NumberFormatter

  • Examples
  • Public
  • My Patches

Changelog


created opuser avatarkikohs - 2022-03-15 17:19
bugfixFixed but with boolean grouping parameteruser avatarpandur - 2024-06-25 16:58