CStr - Built-in Conversion Function¶
See Also¶
Purpose¶
CStr returns an expression converted to a string.
Syntax¶
CStr(exp)
Arguments¶
| Argument | Required | Description |
|---|---|---|
exp |
Yes | Any valid expression |
Returns¶
String
Example¶
Dim nTest
Let nTest = 123.456
Return ("Amount: " + CStr(nTest)) // returns "Amount: 123.456"
Notes¶
- When
expcannot be converted to a string, a runtime error is generated. - Trailing zeroes will be removed (e.g. 12.40 becomes "12.4"). If the trailing zero is needed, use the FormatNumber function.