NEGPARENw.d Format

Writes negative numeric values in parentheses.

Category: Numeric
Alignment: Right

Syntax

NEGPARENw.[d]

Arguments

w

specifies the width of the output field.

Default 6
Range 1–32

d

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

Default 0
Range 0–31

Details

The NEGPARENw.d format attempts to right align output values. If the input value is negative, NEGPARENw.d displays the output by enclosing the value in parentheses, if the field that you specify is wide enough. Otherwise, it uses a minus sign to represent the negative value. If the input value is non-negative, NEGPARENw.d displays the value with a leading and trailing blank to ensure proper column alignment. It reserves the last column for a close parenthesis even when the value is positive.

Comparisons

The NEGPARENw.d format is similar to the COMMAw.d format in that it separates every three digits of the value with a comma.

Example

Statements
Results
----+----1----+
select put(100,negparen6.);
  100
select put(1000,negparen6.);
 1,000
select put(-200,negparen6.);
 (200)
select put(-2000,negparen8.);
(2,000)