Description:
Returns an expression that has been converted to the value of the
Integer type.
In the PROMOTIC system it is better to use the Pm.Round method (or Pm.Trunc, Pm.ToNumber).
Syntax:
Integer CInt(Variant expression)
Parameters:
expression | (Variant) Any valid expression. |
---|
Note:
The conversion functions can be used e.g. if you want some operation result to be expressed as a particular data type (rather than the default data type of the operation). For example, use
CInt or
CLng functions to force integer arithmetic in cases where single-precision, or double-precision arithmetic normally would occur.
Use the
CInt function to provide internationally aware conversion from any other data type to the value of the
Integer type. For example, different decimal separators are properly recognized depending on the locale setting of Windows system, as are different thousand separators.
Example:
VBScriptSelect and copy to clipboard
Dim n
n = CInt(2345.5678)
' Returns 2346
n = CInt(2600)
' Returns 2600