Method: Int for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: Int for VBS
Method: Int for VBS
Specifies the integer part of a number, where the method rounds the number to obtain an integer number. For negative numbers, the method returns integer numbers that are less than or equal to the argument number.
vInt = Object.Int(number)
| Object | VBS Object with this method. You do not need to specify this object. |
| number | Variant Specifies any numeric expression. |
| vInt | Variant Receives the integer part of a number. For negative numbers, the similar Fix method returns integer numbers that are less than or equal to the argument. |
The following example specifies the integer part of various numbers:
Call MsgBox(Int(99.2)) ' Returns 99 Call MsgBox(Int(-99.8)) ' Returns -100 Call MsgBox(Int(-99.2)) ' Returns -100