INTEGER

Parse an integer

Description

Converts the given input value to an integer number. Strings are parsed, and numbers are rounded down. If the input is already an integer, it is returned as-is. Any other values, and invalid strings, result in null value.

Function signature

INTEGER(value: String|Number) => Number

Parameter

Description

Value

Value to convert to an integer

Examples

Formula

Return value

INTEGER("123")

123

INTEGER("123.567")

123

INTEGER("-0896")

-896

INTEGER(5.67)

5

INTEGER("6e-7")

0