This documentation was styled with a demo skin from the Premium Pack 4 add-on for Help & Manual. The contents of the skin are encrypted and not configurable. You can only publish HM projects with this skin. You cannot edit it or change it.
This version is copyright and may only be used for local testing purposes. It may not be distributed.
Please purchase the full version of the Premium Pack to get the configurable skins and remove this notice. The package will also include the Toolbox configuration utility for Premium Pack skins.
Description
Return the string representation of a number in printable form.
Syntax
s = STR$(NumericExpression [, Digits])
Returns
String
Parameters
Name |
Type |
Optional |
Meaning |
NumericExpression |
Numeric |
No |
Any numeric expression to be transformed to string |
Digits |
Numeric |
Yes |
Specifies the maximum number of significant digits (1 to 18) desired in the result. |
Remarks
If NumericExpression is greater than or equal to zero, STR$ adds a leading space character; if NumericExpression is less than zero, STR$ adds a leading negation (minus) character.
See TSTR$ for a trimmed version of STR$
Restrictions
See also
Examples
Thanks to Abraxas for the following script example
' Usage of the STR$ Keyword example
Dim numeric_expression As EXT VALUE 123.4567890123456
Dim digits As DWORD
Dim sMsg As String
sMsg += "Different STR$(numeric_expression, digits) of " & numeric_expression & $CRLF
sMsg += "Digits will be from 1 to 18" & $CRLF & $CRLF
For digits = 1 To 18
sMsg += "Digit = " & digits & " Result: " & STR$(numeric_expression, digits) & $CRLF
Next
MSGBOX 0, sMsg