COMMAw.d Format

Writes numeric values with a comma that separates every three digits and a period that separates the decimal fraction.

Category: Numeric
Alignment: Right

Syntax

COMMAw.[d]

Arguments

w

specifies the width of the output field.

Default 6
Range 1–32
Tip Make w wide enough to write the numeric values, the commas, and the optional decimal point.

d

specifies the number of digits to the right of the decimal point in the numeric value.

Range 0–31
Requirement must be less than w

Comparisons

  • The COMMAw.d format is similar to the COMMAXw.d format, but the COMMAXw.d format reverses the roles of the decimal point and the comma. This convention is common in European countries.
  • The COMMAw.d format is similar to the DOLLARw.d format except that the COMMAw.d format does not print a leading dollar sign.

Example

Statements
Results
----+----1----+----2
select put (23451.23,comma10.2);
          23,451.23
select put (123451.234,comma10.2);
         123,451.23
Last updated: February 23, 2017