Difference between revisions of "MC-Basic:STRD$"

From SoftMC-Wiki
Jump to: navigation, search
Line 21: Line 21:
  
 
<pre>
 
<pre>
%f - output is presented in a non-exponent style
+
%f - the output is presented in a non-exponent style
%e, %E - output is presented in an exponent style
+
%e, %E - the output is presented in an exponent style
%g, %G - output's style depends on the value of the input  
+
%g, %G - the output's style depends on the value of the input  
 
</pre>
 
</pre>
  

Revision as of 09:06, 20 March 2014

STRD$ returns the string representation of a double-type number.

Syntax

STRD$(<number>, <format_string>)

Type

<return value>: String
<number>: Double, Long
<format_string>: String

Range

<number>: MinDouble to MaxDouble
<format_string>: a valid sprintf() floating point format

%f - the output is presented in a non-exponent style
%e, %E - the output is presented in an exponent style
%g, %G - the output's style depends on the value of the input 

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

See Also