#toInteger
Returns a value converted to a whole number.
#toInteger(value)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
value |
path | value |
The value to convert. |
Returns
Section titled “Returns”integer
- Throws when the value can’t be converted. Wrap it in
#tryto supply a fallback.
Examples
Section titled “Examples”Parse a numeric string
Section titled “Parse a numeric string”{ "text": "42"}{ "result": "#toInteger($.text)"}{ "result": 42}Related
Section titled “Related”#toDecimal · #isInteger · #try
