SyntaxDim result As Integer = CInt(expression)
DescriptionThe CInt function converts expression to the Integer data type; any fractional portion of expression is rounded. Usage at a Glance
ExampleDim targetNumber As Integer If IsNumeric(stringNumber) Then targetNumber = CInt(stringNumber) End If Version DifferencesThe CInt function under .NET most closely corresponds to the VB 6 CLng function, since both return 32-bit integers. See AlsoCLng Function, CShort Function, CUInt Function |