Specifications

Chapter 14. Statement Reference
300
numericformat
numericformat is a formatting string consisting of #, decimal point (.), and/or +,
each of which causes a special printing effect as described below.
# Represents a digit position.
If the number specified by
expression has fewer digits than the number
of digit positions specified by
#, then it is padded with spaces and right-justi-
fied.
If the number specified by expression has more digits than the number
of digit positions specified by
#, the extra digits before the decimal point are
truncated and those after the decimal point are rounded.
. Specifies the position of the decimal point.
If the number specified by
expression has fewer digits than the number
of digit positions specified by
# after the decimal point, then the insufficient
digits appear as zeros.
+ Displays the sign of the number.
If
+ is at the beginning of the format string, the sign appears before the num-
ber specified by
expression; if + is at the end of the format string, the
sign appears after the number. If the number specified by
expression is
a positive number or zero, it is preceded or followed by a space instead of a
sign. (+)
Statement example:
PRINT USING "#####";123
Output:
Statement example:
PRINT USING "###.#";1234.56
Output:
Statement example:
PRINT USING "####.###";123
Output:
Statement example:
PRINT USING "+#####";-123
Output:
123
234.6
123.000
-123
( is a space.)