|
NUMBER TO STRING (LET)Name:
Specifically, given the number 23.84 and the command
the parameter will be written in the following format to the string:
where <a> is a parameter or number; and <sout> is a string. Although you can enter an explicit number with this command, it is usually a parameter that is entered.
LET AVAL = 32.1 LET SOUT = NUMBER TO STRING AVAL
Note that the SET PARAMETER EXPAND DIGITS command applies to all parameter substitions encountered. If this value is set to 0 or a positive integer, it will act similar to the NUMBER TO STRING command (i.e., F or I formats). However, it does not support exponential format. The SET PARAMETER EXPANSION command can be used to specify that parameter substitutions will be converted to exponential format. However, this is intended for the case when the parameters are being used in numerical computations. It does not generate the numbers in a format that is attractive for printing. In general, the SET PARAMETER EXPAND DIGITS and SET PARAMETER EXPANSION were developed in the context of using parameter substitution in numerical computations while the NUMBER TO STRING is intended for printing or display on plots.
let a = 32.1 let b = 0.2345/10**8 set write decimal 2 let sout1 = number to string a set write decimal -7 let sout2 = number to string a let sout4 = number to string b set write decimal 0 let sout3 = number to string a . crlf on move 50 80 text A = ^sout1 text A = ^sout2 text A = ^sout3 text B = ^sout4 . move 50 30 text A = ^a (default) set parameter expand digits 2 text A = ^a (digits = 2) set parameter expand digits 0 text A = ^a (digits = 0) set parameter expansion exponential text A = ^a (digits = exponential) text B = ^b (digits = exponential)
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 06/30/2015 |