Skip to content

TO_INT

Info

New in Atfinity 17.

Description

TO_INT converts a value to an integer. Decimals — and decimal strings like '7.9' — are truncated towards zero. Numbers with a unit are converted to their plain number, dropping the unit. A value that cannot be converted returns unknown.

Syntax

TO_INT(value)

Returns: an integer, or unknown if the value cannot be converted.

Example

TO_INT('42')

This returns 42.

TO_INT(7.9)

This returns 7 (TO_INT('7.9') also returns 7).

TO_INT('not a number')

This returns unknown.