FSTRL(n)
Converts a real number into a character string. The maximum number of characters which this function can return is 30, including the decimal point and minus sign.
The 30 character limit is set so that you can use the string in the MESSG statement directly (MESSG has a limit of 60 characters per line). For example:
MESSG/'I = ' + FSTRL(i)
The resulting string has a leading zero when the number is less than one, but greater than negative one.
You may use &DECPL to control the number of decimal places that appear to the right of the decimal point. The default number of decimal places is 4 (if &DECPL is not used).
NOTE: Please note the following items:
This function rounds up rather than truncating digits when specifying less than the significant number of digits with &DECPL or with the default number of decimal places if &DECPL is not used. For example, if you set &DECPL=0, then FSTRL(2.5) rounds up to 3.
If you set &DECPL = 0, the decimal point returns in the string.
Parameter |
Description |
n |
Real number which is to be converted to a character string. This function returns 30 characters (including the decimal point and minus sign). |