Skip to main content

CInt()

Converts a numeric expression into one of an integer data type.  In the example below when we changed a double into an integer the fractional portion is rounded.

Script

Sub Main

     Dim myNumber As Double
     myNumber = 55.4
    
     MsgBox TypeName(myNumber) 'Returns Double
     MsgBox TypeName(CInt(myNumber)) 'Returns Integer
     MsgBox CInt(myNumber) 'Returns 55
End Sub

IDEAScript Language