Format as currency or unit
Write a number as money (1,234.50 EUR in the locale's way), as a percentage (15%) or with a unit (12.5 kg).
Command in the Number toolkit · id ooa.number/format_as · 8 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Value | Number | Yes | Number to format. | |
| Style | String | No | currency | Money, percentage or a number with a unit. |
| Currency | String | No | USD | Three-letter currency code, e.g. USD, EUR, GBP, INR, JPY. |
| Unit | String | No | The unit, e.g. kg, hours, pcs, km/h. | |
| Locale | String | No | en-US | Locale for separators and symbol position, e.g. en-US, de-DE, en-IN, fr-FR. |
| Decimals | Number | No | Decimal places; empty: the currency's own (2 for EUR, 0 for JPY), 0 for percent, as given for units. | |
| Value is a fraction (0.15 is 15%) | Boolean | No | true | When ticked 0.15 shows as 15%; when not, 15 shows as 15%. |
| Unit before the number | Boolean | No | false | Write the unit first, e.g. Rs 120 instead of 120 Rs. |
Outputs
| Output | Type | What it is |
|---|---|---|
| text | String | The formatted text. |