VB : CInt Function

Posted by Fluffy | 7:38 PM | , , | 0 comments »

Using CInt function in VB


CInt is a function that is used for converting data to Integer data type. It is normally used in circumstances where double-precision, single-precision, currency and other multi-decimal points figures occur. The simple example below shows how CInt can be applied in Visual Basic codes.


Dim myData As Double '-----Declaration of variable
Dim Output As Integer

myData= 5469.855 '----- Initialization of data

Output = CInt(myData) '----convert myData into Integer

MsgBox(Output) '----- output data is 5470


Hence, the result above shows the conversion from a Double data type into Integer Data type using CInt.

See Also CType Functions

0 comments