Converting Numbers
Before trying to convert a string to a number it is a good idea to always make sure that the value is a numerical value.
The ISNUMERIC function will return True or False depending if the value can be evaluated as a number.
String to Integer
The CINT function converts a String to an Integer data type.
String to Long
The CLNG function converts a String to a Long data type.
String to Single
The CSNG function converts a String to a Single data type.
String to Double
The CDBL function converts a String to a Double data type.
String to Decimal
The CDEC function converts a String to a Decimal data type.
Decimal to Integer
When you convert a Decimal value to a Long integer value it gets rounded to the nearest integer value.
Digits less than 5 are rounded down
Digits greater than 5 are rounded up
If the digit is 5, then it looks at the digit immediately before the decimal place
1) if its even, its rounded down
2) if its odd, its rounded up
3) if there is no digit, its rounded down
CLng(8.5) = 8 (because 8 is even)
CLng(9.5) - 10 (because 9 is odd)
Number to String
The CSTR function converts a Number to a String data type.
More info Data Types > Converting
More info Numbers > Fixed Point
More info Numbers > Floating Point
© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext