FLTFIXDEC (Floating-Point to Fixed Decimal) keyword for display files

You use this field-level keyword to display a number in an output-capable (usage B or O) floating-point field in fixed-decimal notation.

This keyword has no parameters.

The floating-point number is first converted to the equivalent number with an exponent of zero. If the resulting number (digits and exponent) will fit in the field defined by the length and decimal positions values, the number is displayed with the exponent suppressed and aligned at the decimal point. If the number will not fit in the field defined by the length and decimal position values, the number is displayed in standard floating point form, n.nnnnnnE+nnn. When FLTFIXDEC is specified, the display length of the field is the DDS length plus 2 (the sign and the decimal point). The minimum length of the field is 6.

When the number is too large or small for the fixed-point form specified by FLTFIXDEC with the total digits and fractional digits specified for the field, a floating point form is displayed that presents the significand as follows. (The significand is the string of digits including the sign and decimal point to the left of the exponent character E.)
  • Total significand decimal digits: DDS total digits minus 5
  • Fractional significand digits: DDS total digits minus 6

FLTFIXDEC has no effect on the input format of the data. Numbers can be typed into the field in either fixed point or floating point format. When displayed again, however, FLTFIXDEC will be used to determine the display format.

Option indicators are not valid for this keyword.

Example

The following example shows how to specify the FLTFIXDEC keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A          R RECFMT1
     A            FIELD1        10F 3B  1  2FLTFIXDEC
     A                                      FLTPCN(*DOUBLE)
     A

The output numbers for the example will be converted as follows:

Output number Displayed as
-4.99994321000000E-004 '-4.9999E-004'
-5.00010000000000E-004 ' -0.001'
-2.69123400000000E-002 ' -0.027'
-0.00000000000000E+000 ' 0.000'
0.00000000000000E+000 ' 0.000'
2.71828182845900E++003 ' 2718.282'
3.14159000000000E-052 '3.1416E-052'
9.87654321012345E+006 '9876543.210'
9.99999999960000E+006 '1.0000E+007'