s = CStr(expression)
|expression||(Variant) Any valid expression. The data in expression determines what is returned according to the following table:|
Boolean - a string containing true or false
Date - a string containing a date in the short-date format of your system
Null - a runtime error
Empty - a zero-length string ("")
Other numeric - a string containing the number
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). For example, use CStr to force the result to be expressed as a String.
You should use the CStr function to provide internationally aware conversions from any other data type to a String type. For example, different decimal separators are properly recognized depending on the locale setting of your system.
Dim nDouble, sString
nDouble = 437.324
sString = CStr(nDouble) 'sString contains "437.324"