TO_INTEGER
Description
Converts a value to an Integer. If the input cannot be converted, the function throws an error.
Syntax
TO_INTEGER(string/decimal/double/float/integer) -> Integer
Parameters
| Parameter | Data Type | Required | Description |
|---|---|---|---|
| string/decimal/double/float/integer | String/Decimal/Double/Float/Integer | Yes | The string to convert into a Integer |
Examples
TO_INTEGER("25")
-- Returns 25 as an Integer.TO_INTEGER(25.8)
-- Returns 25.Tips
If the input is a string, it must represent an integer; otherwise, an error will occur.
For numeric inputs, any fractional part is truncated rather than rounded.