Home / Search/ Language Reference/ Functions/ Scalar Functions/ Conversion Functions/toint

toint

The toint function converts the input to a value of type int (long).

Aliases: int, long, tolong.

Syntax

toint( Expression )

Arguments

  • Expression: Expression to convert to a value of type int.

Returns

If the type conversion is successful, returns an int value. Decimal places are truncated.

If the type conversion fails, returns null.

Examples

  • toint(123) returns 123
  • toint("123.456") returns 123
  • toint("abc") returns null