Str$ Function
Converts a numeric value to a string and returns it.
Syntax
Str$(number)
Parameters
- number
- Specify the numeric value to be converted to a string, either as an expression or directly as a numeric value.
Return Values
Returns a string representation of the numeric value.
Description
Str$ converts a number to a string. Any positive or negative number is valid.
See Also
Abs Function, Asc Function, Chr$ Function, InStr Function, Int Function, Left$ Function, Len Function, Mid$ Function, Mod Operator, Right$ Function, Sgn Function, Space$ Function, Val Function
Str$ Function Example
The example shown below shows a program which coverts several different numbers to strings and then prints them to the screen.
Function strtest
Integer intvar
Real realvar
'
intvar = -32767
Print "intvar = ", Str$(intvar)
'
realvar = 567.9987
Print "realvar = ", Str$(realvar)
'
Fend
Some other example results from the Str$ instruction from the command window.
> Print Str$(99999999999999)
1.000000E+014
> Print Str$(25.999)
25.999