
Chapter 14. Statement Reference
265
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-justified.
Statement example: PRINT USING "#####";123
Output:
123
( is a space.)
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.
Statement example: PRINT USING "###.#";1234.56
Output:
234.6
. 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.
Statement example: PRINT USING "####.###";123
Output:
123.000
+ Displays the sign of the number.
If + is at the beginning of the format string, the sign appears before the number
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:
-123
]
]
]
]
]
Komentarze do niniejszej Instrukcji