Skip to main content

Int()

The Fix() and Int() functions both remove the fractional part of a number and returns the restulting integer.  The difference between the two is that if a number is negative Int() returns the first negative integer less than or equal to the number while Fix returns the first negative integer greater than or equal to the numer.

Script

Sub Main
    MsgBox Fix(99.8) 'returns 99
    MsgBox Int(99.8) 'returns 99
    MsgBox Fix(-99.8) 'returns -99
    MsgBox Int(-99.8) 'returns -100
    MsgBox Fix(-99.2) 'returns -99
    MsgBox Int(-99.2) 'returns -100

End Sub

IDEAScript Language