NEGPARENw.d Format

Writes negative numeric values in parentheses.
Category: Numeric
Alignment: right

Syntax

NEGPARENw.d

Syntax Description

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

put @1 sales negparen8.;
Value of sales
Result
----+----1----+
100
    100
1000
  1,000
-200
   (200)
-2000
 (2,000)