Int

Converts a floating point number or a string to an integer.

Syntax:

Int(x)

Parameters:

(s) x value to be converted.

Returns:

(i) an integer.

 

Use this function to convert a floating point number or a string to an integer. If the argument is a string, it is first converted to a number- if possible. If the argument is a number within integer range, it will be converted to the closest integer.

Note:The Int function truncates 64-bit integers to 32-bits when the integer is larger or smaller than the maximum or minimum 32-bits integer.

Example:


a=Int(5.1) + Int("123")
Message("Result is", a)
; a= 5+123 = 128
See Also:

IsInt, IsFloat, IsNumber