Friday, June 11, 2010

Int Function

Function returns the integer portion of the number
Dim MyValue, MyReturn
MyValue = 3.653
MyReturn = Int(MyValue)
MsgBox MyReturn

MyInt = Int(99.8) ' Returns 99.
MyInt = Int(-99.8) ' Returns -100.
MyInt = Int(-99.2) ' Returns -100.
MyInt = Int(6.83227) ' Returns 6
MyInt = Int(6.23443) ' Returns 6
MyInt = Int(-6.13443) ' Returns -7
MyInt = Int(-6.93443) ' Returns -7

No comments: