Text to number
Read a number from text written for a locale, or with the decimal and grouping separators you give.
Command in the String toolkit · id ooa.string/to_number · 5 inputs (1 required), 1 output
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Text | String | Yes | Text such as 1,234.56, 1.234,56, $ 1,200.50, (1,234.00) or 1,234.00- (negative). | |
| Locale | String | No | en-US | Locale the text is written in, e.g. en-US, de-DE, fr-FR. |
| Decimal separator | String | No | Decimal separator; overrides the locale. | |
| Grouping separator | String | No | Thousands separator; overrides the locale. | |
| Ignore currency | Boolean | No | true | Ignore a currency symbol or code before or after the number ($, €, ₹, USD, EUR, Rs.); when off such text is not a number. |
Outputs
| Output | Type | What it is |
|---|---|---|
| result | Number | The number. |