w.d Informat

Reads standard numeric data.
Category: Numeric
Alias: BESTw.d, Dw.d, Ew.d, Fw.d

Syntax

Syntax Description

w
specifies the width of the input field.
Range:1–32
d
specifies the power of 10 by which to divide the value. If the data contain decimal points, the d value is ignored. This argument is optional.
Range:0–31

Details

The w.d informat reads numeric values that are located anywhere in the field. Blanks can precede or follow a numeric value with no effect. A minus sign with no separating blank should immediately precede a negative value. The w.d informat reads values with decimal points and values in scientific E-notation, and it interprets a single period as a missing value.

Comparisons

  • The w.d informat is identical to the BZw.d informat, except that the w.d informat ignores trailing blanks in the numeric values. To read trailing blanks as 0s, use the BZw.d informat.
  • The w.d informat can read values in scientific E-notation exactly as the Ew.d informat does.

Example

input @1 x 6. @10 y 6.2;
put x @7 y;
Data Line
Result
----+----1----+
----+----1----+
23        2300
23    23
  23   2300
23    0
23       -2300
23    -23
23.0       23.
23    23
2.3E1     2.3
23    2.3
-23     0
-23   .