Previous Page | Next Page

Formats

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
Syntax Description
Details
Comparisons
Examples
See Also

Syntax

DOLLARw.d

Syntax Description

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. This argument is optional.

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. If you need another monetary character, define your own format with the FORMAT procedure. See The FORMAT Procedure in Base SAS Procedures Guide for more details.


Comparisons


Examples

put @3 netpay dollar10.2;

Value of netpay Results

----+----1----+
1254.71
   $1,254.71


See Also

Formats:

COMMAw.d Format

DOLLARXw.d Format

Previous Page | Next Page | Top of Page