Returns an expression that has been converted toIntegerSubtypeVariant。
expressionArgument is any valid expression.
In general, you can write code using subtype conversion functions to show that the results of some operations should be represented as a specific data type rather than the default type. For example, in the case of currency, single precision or double precision operations, useCIntorCLngEnforces integer operations.
CIntThe function is used to transfer data from other data types toIntegerSubtypes are converted to internationally recognized formats. For example, the identification of decimal separators, such as the thousand separator, may depend on the locale of the system.
IfexpressionAn error occurs when the integer subtype is outside the acceptable range.
The following example usesCIntThe function converts a value to integer:
Dim mydouble, myintmydouble = 2345.5678 'mydouble is a double. Myint = cint (mydouble) 'Myint contains 2346.
be careful CIntdifferFixandIntThe function removes the decimal part of a value and rounds it. When the decimal part is exactly equal to 0.5,CIntAlways round it to the nearest even number. For example, 0.5 is rounded to 0, and 1.5 is rounded to 2