DOLLARw.d Format

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

Category: Numeric
Alignment: Right

Syntax

DOLLARw.[d]

Arguments

w

specifies the width of the output field.

Default 6
Range 2–32

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

Details

The DOLLARw.d format writes numeric values with a leading dollar sign, a comma that separates every three digits, and a period that separates the decimal fraction.
The hexadecimal representation of the code for the dollar sign character ($) is 5B on EBCDIC systems and 24 on ASCII systems. The monetary character that these codes represent might be different in other countries, but DOLLARw.d always produces one of these codes.

Comparisons

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

Example

Statements
Results
----+----1----+
select put(1254.71,dollar10.2);
...$1,254.71
Last updated: February 23, 2017