Next: Custom Currency Formats, Up: Input and Output Formats [Contents][Index]
The basic numeric formats are used for input and output of real numbers in standard or scientific notation. The following table shows an example of how each format displays positive and negative numbers with the default decimal point setting:
Format | 3141.59 | -3141.59 |
---|---|---|
F8.2 | 3141.59 | -3141.59 |
COMMA9.2 | 3,141.59 | -3,141.59 |
DOT9.2 | 3.141,59 | -3.141,59 |
DOLLAR10.2 | $3,141.59 | -$3,141.59 |
PCT9.2 | 3141.59% | -3141.59% |
E8.1 | 3.1E+003 | -3.1E+003 |
On output, numbers in F format are expressed in standard decimal notation with the requested number of decimal places. The other formats output some variation on this style:
On input, the basic numeric formats accept positive and numbers in standard decimal notation or scientific notation. Leading and trailing spaces are allowed. An empty or all-spaces field, or one that contains only a single period, is treated as the system missing value.
In scientific notation, the exponent may be introduced by a sign (‘+’ or ‘-’), or by one of the letters ‘e’ or ‘d’ (in uppercase or lowercase), or by a letter followed by a sign. A single space may follow the letter or the sign or both.
On fixed-format DATA LIST
(see DATA LIST FIXED) and in a few
other contexts, decimals are implied when the field does not contain a
decimal point. In F6.5 format, for example, the field 314159
is
taken as the value 3.14159 with implied decimals. Decimals are never
implied if an explicit decimal point is present or if scientific
notation is used.
E and F formats accept the basic syntax already described. The other formats allow some additional variations:
All of the basic number formats have a maximum field width of 40 and accept no more than 16 decimal places, on both input and output. Some additional restrictions apply:
More details of basic numeric output formatting are given below:
3
in F1.0 format, and -1.125 as -1.13
in F5.1
format.
In scientific notation, the number always includes a decimal point, even if it is not followed by a digit.
-$9.99
.
+Infinity
or -Infinity
for infinities, from
NaN
for “not a number,” or from Unknown
for other values
(if any are supported by the system). In fields under 3 columns wide,
special values are output as asterisks.
Next: Custom Currency Formats, Up: Input and Output Formats [Contents][Index]