Method: CInt for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: CInt for VBS
Method: CInt for VBS
Converts an expression into the Variant type with the Integer subtype.
vCInt = Object.CInt(expression)
| Object | VBS Object with this method. You do not need to specify this object. |
| expression | Variant Specifies any expression. |
| vCInt | Variant Receives the converted value. During conversion the CInt method includes the locale settings of your computer, for example decimal points and thousands separators. |
The following example converts a text into an integer:
Dim MyDouble MyDouble = 12345.5678 ' Defines a Double Call MsgBox(CInt(MyDouble)) ' Returns 12346