Using number display formats

Applies to

Display formats

Description

A number display format can have up to four sections. Only the first is required.

Positive-format;negative-format;zero-format;null-format

The following table shows characters that have special meaning in number display formats.

Table 4-5: Special characters in number display formats

Character

Meaning

#

A number

0

A required number; a number will display for every 0 in the mask

Dollar signs, percent signs, decimal points, parentheses, and spaces display as entered in the mask.

These keywords tell PowerBuilder to determine an appropriate format based on system settings:

Examples

Example 2

The following table shows how the values 5, -5, and .5 display when different format masks are applied.

Table 4-6: Number format examples

Sample format

5

-5

.5

[General]

5

-5

0.5

0

5

-5

1

0.00

5.00

-5.00

0.50

#,##0

5

-5

1

#,##0.00

5.00

-5.00

0.50

$#,##0;($#,##0)

$5

($5)

$1

$#,##0;-$#,##0

$5

-$5

$1

$#,##0;[RED]($#,##0)

$5

($5)

$1

$#,##0.00;($#,##0.00)

$5.00

($5.00)

$0.50

$#,##0.00;[RED]($#,##0.00)

$5.00

($5.00)

$0.50

0%

500%

-500%

50%

0.00%

500.00%

-500.00%

50.00%

0.00E+00

5.00E+00

-5.00E+00

5.00E-01