Overview | Statement List | Example
FSTR(n)
Converts a real number into a character string. The maximum number of characters which this function can return is eight, including the decimal point and minus sign. To return more than eight characters, use the FSTRL statement.
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.
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 FSTR(2.5) rounds up to 3.
If you set &DECPL = 0, the decimal point does not return in the string.
Parameter |
Description |
n |
Real number which is to be converted to a character string. This function returns a maximum of 8 characters (including the decimal point and minus sign). If you attempt to convert a real number which generates more than eight characters, then this command returns a string of nines (e.g. '9999999') which indicates an overflow error. |