On This Page

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

tolong ​

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

Aliases: long, int, toint.

Syntax ​

tolong( Expression )

Arguments ​

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

Returns ​

If the type conversion is successful, returns a long number. Decimal places are truncated.

If the type conversion fails, returns null.

Example ​

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