PERCENTw.d Format

Writes numeric values as percentages.

Category: Numeric
Alignment: Right

Syntax

PERCENTw.[d]

Arguments

w

specifies the width of the output field.

Default 6
Range 4–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 PERCENTw.d format multiplies values by 100, formats them the same as the BESTw.d format, and adds a percent sign (%) to the end of the formatted value, while it encloses negative values in parentheses. The PERCENTw.d format allows room for a percent sign and parentheses, even if the value is not negative.

Example

Statements
Results
 
----+----1----+----2
select put(0.1,percent10.);
               10%
select put(1.2,percent10.);
              120%
select put(-.05,percent10.);
         (      5%)

See Also