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