Int
Returns the integer portion of a number.
Syntax
Int(Val)
Parameters
Val
Type: Double
A numeric value.
(return)
Type: Long
The greatest integer that is less than or equal to Val.
Remarks
An error occurs if Val is outside the range of integer values that can be stored in the Long data type (-2,147,483,648 to 2,147,483,647). If the current data value is NULL, Val is 0.0 and the return value is 0.
This function is similar to the Int function in VBScript.
Example
The following mrScriptBasic example uses the Int function to return the integer portion of a number:
Dim MyInteger1, MyInteger2, MyInteger3
MyInteger1 = Int(9.88) ' Returns 9
MyInteger2 = Int(-9.88) ' Returns -10
MyInteger3 = Int(12345678901234.89) ' Error
See also