NumberFormatter Op
Format a number to a string in the given locale and format
Summary (oneliner)
<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>
- Ops.String.NumberFormatter
- Core Op - Official cables op
- MIT
- caniuse.com: Date%20toLocaleString
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch NumberFormatter Example
INPUT PORTS
<i>integer</i>
) browser custom<p>A string with a BCP 47 language tag</p>
<i>integer</i>
) decimal currency percent<p>The formatting style to use</p>
Format
<i>integer</i>
)<p>The minimum number of integer digits to use. Possible values are from 1 to 21</p>
<i>integer</i>
)<p>The minimum number of fraction digits to use. Possible values are from 0 to 20</p>
<i>integer</i>
)<p>The maximum number of fraction digits to use. Possible values are from 0 to 20</p>
Significant Digits
<i>integer</i>
)<p>The maximum number of significant digits to use. Possible values are from 1 to 21</p>
<i>integer</i>
)<p>The minimum number of significant digits to use. Possible values are from 1 to 21</p>
<i>boolean</i>
)<p>Whether to use grouping separators, such as thousands separators.</p>
Currency
<p>The currency to use in currency formatting. Possible values are the ISO 4217 currency codes.</p>
<i>integer</i>
) symbol code name<p>How to display the currency in currency formatting</p>
OUTPUT PORTS
<i>boolean</i>
Number)