Difference between revisions of "MC-Basic:STRD$"
Line 35: | Line 35: | ||
-->PRINT STRD$(45.5, "%f")<br> | -->PRINT STRD$(45.5, "%f")<br> | ||
45.500000<br> | 45.500000<br> | ||
+ | -->PRINT STRD$(45.5,"%g")<br> | ||
+ | 45.5<br> | ||
+ | -->PRINT STRD$(45.5,"%e")<br> | ||
+ | 4.550000e+01 | ||
|SEE ALSO= | |SEE ALSO= |
Revision as of 14:17, 19 March 2014
STRD$ returns the string representation of a number.
Syntax
STRD$(<number>, <format_string>)
Type
<return value>: String
<number>: Long, Double
<format_string>: String
Range
<number>: MinDouble to MaxDouble
<format_string>: a valid sprintf() floating point format
Scope
Configuration, Task or Terminal
Limitations
Read only
Examples
-->PRINT STRD$(45.5, "%f")
45.500000
-->PRINT STRD$(45.5,"%g")
45.5
-->PRINT STRD$(45.5,"%e")
4.550000e+01