11. Report-Writer Expressions and Formats : Format Specifications : Numeric Format F
 
Share this page                  
Numeric Format F
The F format causes Report-Writer to print numeric expressions in standard decimal notation, with or without a decimal point. Numbers in F format are right justified in the field, unless preceded by a .left statement or by the minus sign (-) in the format designation.
The syntax of an F format specification is:
[-|*|+] fw[.d]
where:
w
Specifies the maximum field width.
d
Specifies the precision or the number of digits to print after the decimal point.
The minus sign (-) and plus sign (+) characters, when used as prefixes for the format specification, specify how the entire text must appear in the field--as either right or left justified. They do not refer to the placement of the sign of the number, as is the case in some programming languages.
You can specify this format with either uppercase or lowercase letters. Specify the field width w, which refers to the maximum number of printing positions in the field. If the value can be printed in fewer than w spaces, Report-Writer right justifies it in the field. If the value cannot be printed in w or more spaces, Report-Writer fills the entire field with asterisks (*).
If you specify d, Report-Writer prints a decimal point followed by d digits to the right of the decimal point. The number of digits to the left of the decimal point is a maximum of (w - (d + 1)), because you need to account for the fractional part in the field-width specification.
If you do not specify d, or if you specify a value of "0" for d (for example, F20.0), Report-Writer does not print a decimal point and rounds off any fractional digit for floating point data while truncating decimal data types. If you need to round decimal data, use a numeric template (see page Numeric Templates) format.
The following table illustrates the F format specification. The carets (^) in the Output column are used here only to show where blanks occur in the output; they do not print in your report.
Format
Value
Output
f10.2
22.3
^^^^^22.30
F10.2
-.123
^^^^^-0.12
f10
123.789
^^^^^^^124
f4.2
22.34
****
+f10.2
22.6
^^^^^22.60
-f10.2
22.6
22.60^^^^^