Progress
Results User’s Guide
for UNIX
Numeric Display Formats
As with character data, the format you specify for a numeric value determines how Results displays that value, but not how it stores that value.
When specifying a numeric data format, you must use at least one of the following characters: 9, z, *, or >. You can use many different symbols to describe the display format of decimal and integer fields: ( + > , 9 z * . < DR CR and DB. For example, the default display format for a decimal field is ->>,>>9.99 and the default display format for an integer field is ->,>>>,>>9.
If you use the European Numeric Format (-E) startup option, numbers on your screen appear in European numeric format. So, the default format for decimal numbers is ->>.>>9,99 and the default format for integers is ->>.>>>.>>99. That is because when you use the -E startup option, Results uses a comma (,) to mark the decimal location in fields and periods (.) to mark thousands. When you use the -E startup option, European format is just the way Results displays the data, not the way Progress uses the data. Therefore, when you enter literal Progress expressions in the Expert Mode in any Results module or in a VALUE function in report headers or footers, use a period (.) to represent the decimal point.
NOTE: When you use the VALUE function in report headers and footers, always use American format. (If you enter a European numeric format for the VALUE function, an error message appears.) When you use the GET key to pick and define a VALUE function in report headers and footers, it always automatically appears in American format.Table C–4 defines the symbols you can use to define numeric field display formats. It shows the American use of these symbols, but if you use the -E startup option, you see their European uses.
Table C–4: Numeric Field Display Format Symbol Use of Description ( ) Parentheses display 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 (.). + A plus sign puts a plus sign in front of the number if the number is positive, and a negative sign if the number is negative. You can use only one plus or minus sign, or DR, CR, or DB, or one set of parentheses in a numeric data format. The position of the plus sign in the number format can also hold a digit if the number is positive. - A dash puts a minus sign in front of the number if the number is negative, and puts a blank in front of the number if the number is positive. > A greater than sign is replaced with a digit if that digit is not a leading zero. If the digit is a leading zero, the screen replaces > with a blank. , A comma displays as a comma unless it is preceded by a > sign or a Z. If the comma is preceded by > and the > is replaced with 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. 1 9 The number 9 is replaced by a digit.
A period represents a decimal point in American format. 1 Z The letter Z is replaced with a digit. If the digit is a leading zero, Z suppresses that digit, putting a blank in its place. * The asterisk character is replaced with a digit. If the digit being replaced is a leading zero, that zero is replaced with an asterisk. < The less than symbol is used in conjunction with > to implement “floating decimal” format. See Table C–5. DR,CR,
DB These characters display if the number is negative. If the number is positive, blanks appear in place of these characters. Results does not treat these characters as sign indicators when you specify string2; it considers them to be 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 (*).
Use the greater than and less than symbols (< and >) together to cause a “floating decimal” display. In a floating decimal display, there are a set number of digits, and the decimal point can appear anywhere within the number. Up to ten < symbols can follow a decimal point. The < symbols must be balanced by an equal or greater number of > symbols to the left of the decimal. A < is replaced by a digit if its corresponding > is eliminated by a leading zero (and the stored value has the required precision).
Table C–5 shows some examples of how Results displays numeric values using different formats.
NOTE: If you use the European Numeric Format (-E) startup option, a comma (,) marks the decimal location in fields and periods (.) mark thousands. Table C–5 illustrates the US/Canadian format, where the meaning of those markers is reversed.
Table C–5: Numeric Format Examples Format Value Display 9999 123 0123 9,999 1234 1,234 $zzz9 123 $123 $>>>9 123 $1231 $- >, >>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
- This display value is right-justified if it has a column label. It is left-justified if it has a side label.
- 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.
- In this example, the value 1234567 is simply too large to fit in the display format of $>,>>9.99. The result is a string of question marks.
- This is an example of the “floating decimal” display format. The < symbols must follow the decimal point and be balanced by an equal or greater number of > symbols.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |