CInt - Built-in Conversion Function¶
See Also¶
Purpose¶
CInt returns an expression converted to an integer.
Syntax¶
CInt(exp)
Arguments¶
| Argument | Required | Description |
|---|---|---|
exp |
Yes | Any valid expression |
Returns¶
Integer
Example¶
Dim nTest
Let nTest = 2345.6789
Return CInt(nTest) // returns 2346
Notes¶
- Expressions results will be rounded. When the fractional part is exactly 0.5, CInt always rounds to the nearest even number.
- The function uses the locale settings to convert
expto integer. - When
expcannot be converted to an integer, a runtime error is generated. - The range is: -2,147,483,648 through 2,147,483,647