Progress
Programming
Handbook


Integer and Decimal Formats

The following is the syntax you can use when specifying the format of an integer or decimal value.

SYNTAX
[ ( ] [ string1 ]
  [ + | - | ( ]
  [ > | , ] ...
  [ 9 | Z | * | , ] ...
  [ . ]
  [ 9 | < | , ] ...
  [ + | - | ) | DR | CR | DB ] 
  [ string2 ] 

( )

Parentheses are displayed if the number is negative. If you use one parenthesis (left or right), you must use the other.

string1

A string made up of any characters except plus (+), minus (–), greater than (>), less than (<), comma (,), digits (0–9), letter z (z or Z), asterisk (*) or period (.).

+

Progress replaces this character with a plus sign (+) if the number is positive and a minus (–) sign if the number is negative. You can use only one plus or minus sign or CR, DR, or DB or one set of parentheses in a numeric data format.

When you use this character to the left of the decimal point, Progress replaces it with a minus sign if the number is negative and a blank or null if the number is positive. When you use this character to the right of the decimal point, Progress replaces this character with a minus sign if the number is negative and a blank if the number is positive.

>

This character is replaced with a digit if that digit is not a leading zero. If the digit is a leading zero, this character is replaced with a null and any characters to the left are moved one space to the right if you are using top labels. They are left justified if you are using side labels. See also <.

,

This character is displayed as a comma unless it is preceded by >, Z, or *. If the comma is preceded by >, and the > is replaced by a leading zero, the comma is replaced with a null. If the comma is preceded by Z, and the Z is replaced by a blank, the comma is replaced with a blank. If the comma is preceded by *, and the * replaces a leading zero, the comma is replaced by *.

9

Progress replaces this character with a digit, including cases where the digit is a leading zero.

Z or z

This character is replaced with a digit. If the digit is a leading zero, Z suppresses that digit, putting a blank in its place.

*

This character is replaced with a digit. If the digit being replaced is a leading zero, that zero is replaced with an asterisk.

.

This character represents a decimal point and is displayed as a period.

<

Used in conjunction with > to implement “floating decimal” format. The < symbol (up to 10) must appear to the right of the decimal and be balanced by an equal or greater number of > symbols left of the decimal. A digit is displayed in a position formatted with < when the corresponding > is a leading zero (and the stored value has the required precision). See Table 17–3.

DR, CR, DB

These characters are displayed if the number is negative. If the number is positive, Progress displays blanks in place of these characters. Progress does not treat these characters as sign indicators when you specify string2; Progress considers them part of string2.

string2

A string made up of any characters except plus (+), minus/hyphen (–), greater than (>), comma (,), any digit (0–9), letter z (z or Z), or asterisk (*).

When specifying a numeric data format, you must use at least one of the following characters: 9, z, *, or >.

Table 17–3 shows some examples of how Progress displays numeric values using different formats.

Table 17–3: Numeric Display Format Examples
Format
Value
Display
9999
123
0123
9,999
1234
1,234
$zzz9
123
$ 123
$ > > >9
123
$123 1
$–>, > > 9.99
1234
$1,234.00
$–>, > > 9.99
1234
$1,234.00
#–zzz9.999
–12.34
#– 12.340
Tot= > > >9Units
12
Tot=12Units
$>, >>9.99
–12.34
????????? 2
$>,>>9.99
1234567
??????? 3
>>,>99.99<<< 4
12,345.6789
12,345.68
>>,>99.99<<<
1,234.5678
1,234.568
>>,>99.99<<<
123.45
123.45
>>,>99.99<<<
12.45678
12.45678
HH:MM:SS5
123456
12:34:56
HH:MM AM5
123456
12:34 AM
  1. This display value is right justified if it has a column label, left justified is it has a side label.
  2. In this example, there is a negative sign in the value –12.34, but the display format of $>,>>9.99 does not accommodate that sign. The result is a string of question marks.
  3. In this example, the value 1234567 is too large to fit in the display format of $>,>>9.99. The result is a string of question marks.
  4. This is a floating-decimal display format. The < symbols must follow the decimal point and be balanced by an equal or greater number of > symbols.
  5. The time format is used with the STRING function. For more information, see the STRING function in the Progress Language Reference manual.

NOTE: If you use the European Numeric Format (–E) startup parameter, Progress interprets commas as decimal points and decimal points as commas when displaying or prompting for numeric values. However, you must enter data in procedures and the Data Dictionary as described above.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095