Microsoft Visual Basic Data Conversion


Asc() -

Converts its string argument to the ASCII number that matches the first (or only) character in the string.


CCur() -

Converts the argument to an equivalent Currency data type.


CDbl() -

Converts the argument to an equivalent Double data type.


CInt() -

Rounds its fractional argument to the next highest integer.


CLng() -

Converts the argument to an equivalent Long data type.


CSng() -

Converts the argument to an equivalent Single data type.


CStr() -

Converts the argument to an equivalent String data type.



CVar() -

Converts the argument to an equivalent Variant data type.


Fix() -

Truncates the fractional portion.


Int() -

Rounds the number down to the integer less than or equal to its arguments.


Hex() -

Converts its numeric argument to a hexadecimal (base-16) value.


Oct() -

Converts its numeric argument to an octal (base-8) value.


Note:


Normally, the following assignment stores .1428571 in a label named lblValue:


   lblValue.Caption = (1 / 7)


The following, however, adds precision to the label for a more accurate calculation to assign .142857142857143 to the label:


   lblValue.Caption = CDbl(1 / 7)