Skip to content

CInt - Built-in Conversion Function

See Also

Conversion functions

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 exp to integer.
  • When exp cannot be converted to an integer, a runtime error is generated.
  • The range is: -2,147,483,648 through 2,147,483,647