The following table describes the tokens you can use in creating a number format mask:
Format Token |
Explanation |
0 |
Prints one digit. |
N |
Prints one digit, unless it is a leading zero to the left of the decimal point or a trailing zero to the right of the decimal point. |
* |
Prints one digit, unless it is a leading zero to the left of the decimal point, in which case an asterisk (*) is printed. Trailing zeros to the right of the decimal point are printed. |
9 |
Prints one digit, unless it is a leading zero to the left of the decimal point, in which case a space is printed. Trailing zeros to the right of the decimal point are printed. |
+ |
Prints a leading plus (+) for positive values and a leading minus (-) for negative values. This token must lead the mask. |
- |
Prints a leading minus (-) for negative values and nothing for positive values. This token must lead the other tokens. |
MI |
Prints a minus (-) after negative values and a space after positive values. This token must trail the other tokens. |
S |
Prints a minus (-) for negative values and a plus (+) for positive values (wherever the S appears in the mask). This token must lead or trail the other tokens. |
PR |
Prints angle brackets (<>) around negative values and spaces around positive values. This token must trail the other tokens. |
( ) |
Prints parentheses around negative values and spaces around positive values. The parentheses must surround the other tokens. |
DB |
Prints a "DB" after positive values. This token must trail the other tokens. |
CR |
Prints a "CR" after negative values. This token must trail the other tokens. |
Y |
Causes no sign symbol to be printed for negative or positive values. |
V |
Causes the number to be multiplied by 10N, where N is the number of 0, 9, *, and S tokens that appear to the right of the V. |
EEEE |
Causes the number to be printed in scientific notation. All digit tokens refer to digits of the mantissa. There must be exactly one digit to the left of the decimal point (displayed or implicit). The token EEEE prints as E followed by a plus (+), if the ordinate is positive or zero, and a minus (-), if the ordinate is negative, and two digits representing the ordinate (for example, E-99). |
"string" |
Prints the string between the double quotes. To have double-quotes inside the string, type double-quotes back to back (""). |
. (period) |
Prints a period (.) to separate the integral and fractional parts of a number. |
D |
Prints the local decimal character to separate the integral and fractional parts of a number. |
, (comma) |
Prints a comma (,) as the group/thousands separator. |
G |
Prints the local group/thousands separator. |
$ |
Prints $. |
L |
Prints the local currency symbol. |
C |
Prints the ISO currency symbol. |
% |
Prints %. |
" " |
Prints a blank space. (Do not include quotes in mask.) |
v |
Prints a blank space for all zero values, regardless of other tokens. |
K |
Prints a blank space. |
<> |
Delineates the beginning and ending of the decimal-aligned region (that is, that part of the number that you want aligned with the decimal point in the format mask). Angle brackets indicate that the number should always occupy the same amount of space. If necessary, values are padded with blanks to the left or right of the decimal point. Note: this is ignored in HTML files or when using proportional fonts. |
RN, rn |
Prints values in uppercase or lowercase Roman numerals, respectively. You cannot enter any other tokens with this token. |
For number format masks, if the actual value is longer than the specified format mask, the value will appear as a string of asterisks in the report output, regardless of the field's width. For example, if a fixed field's width is 8, the value is 1234567, and the format mask is <NNNNNN>, your output will be *******.
Similarly, if the number format mask causes the value to be larger than the field width, asterisks will appear in place of the value. For example, if a fixed field's width is 6, the value is 1234, and the format mask is -99999999, your output will be ******. This occurs because the format token 9 prints a blank for leading zeros to the left of the decimal. As a result, the value is too long to be displayed in a field of width 6.
If you do not specify a sign token in the format mask, positive values are preceded by a space and negative values are preceded by a minus (-).
After you create a format mask it will display in the list of values only if it is an appropriate format mask for the Datatype of the Source. That is, format masks for numbers are displayed when the Source is a number, and format masks for dates are displayed when the Source is a date.
Format masks that print spaces for zeros (for example, 9) increase the number of bytes per page taken up by your output.
Sample Number Format |
Number |
Number Displayed |
-0000 |
7934 |
"7934" |
|
-7934 |
"-7934" |
-00000 |
7934 |
"07934" |
-NNNN |
7639 |
"7639" |
|
535 |
"535" |
-NNN |
7639 |
"****" |
-**** |
7902 |
"7902" |
-***** |
7902 |
"*7902" |
+NNNN |
100 |
"+100" |
|
-99 |
"-99" |
(NNNN) |
1600 |
" 1600 " |
|
-800 |
"(800)" |
NNNNPR |
1600 |
" 1600 " |
|
-800 |
"<800>" |
NNNNMI |
1600 |
"1600 " |
|
-800 |
"800-" |
NNNVNN |
343 |
"34300" |
N.NNEEEE |
7369 |
"7.37E+03" |
"SRW"-0000 |
7782 |
"SRW7782" |
-$NNNN.NN |
800 |
"$800" |
|
1600 |
"$1600" |
-%NNN |
10 |
"%10" |
-NN NNN.NN |
3000 |
"3 000" |
+KKNNNNN.00 |
1950 |
"+ 1950.00" |
|
900 |
"+ 900.00" |
$<NNNNN.00> |
1200 |
"$ 1200.00" |
|
500 |
"$ 500.00" |
$<NNNNN.00> DB |
1200 |
"$ 1200.00 DB" |
|
-500 |
"$ 500.00" |
$<NNNNN.00> CR |
1200 |
"$ 1200.00" |
|
-500 |
"$ 500.00 CR" |
* The quotation marks will not appear in your output. They are used here to make it clear where there are leading or trailing spaces.
Applying a format mask to a numeric object
Applying a format mask to a date object
Changing the format mask for multiple fields
Specifying date and time format masks
Copyright © 1984, 2005, Oracle. All rights reserved.