For numbers, you can use these format masks:
To... |
Use... |
Place a number in that space (0-9) |
9 |
Place any number except a zero |
Z |
Indicate the number is an amount |
$ |
Place a currency symbol to the right of the amount (the second $indicates which symbol) |
$$ |
Place a minus sign (-) beside the amount if it is negative |
- |
Place a minus (-) or plus (+) sign beside the amount |
+ |
Indicate a credit (accounting format) |
CR |
Indicate a debit (accounting format) |
DB |
Indicate a debit (accounting format) |
() |
Include an asterisk ($*999) |
* |
Place a percent sign (%) after the number |
% |
You determine whether the minus (-) or plus (+) signs appear before or after the amount when you choose the field's format on the field’s Properties window in Studio.
When you choose the format in Studio, the system lets you choose from a list of examples, such as:
+$ZZZZZZZZZ9.99
$$ZZ,ZZZ,ZZZ,ZZZ
$ZZZZZZZZZ9.99CR
$*ZZZZZZZZZZZ.ZZ
The FmtNum rule can use a pre-defined numeric format to suppress decimals. The format is 0 (zero). You can only use this format after the decimal and at the end of the value. You cannot place format code 9 or Z after you specify the zero (0) format code.
Here are some examples of how the Z format and the zero (0) format work together.
Format Z,ZZZ.0Z |
Format: Z,ZZZ.00 |
Format Z,ZZZ.Z0 |
Input = 9999.00 |
Input = 9999.00 |
Input = 9999.00 |
Output = 9,999 |
Output = 9,999 |
Output = 9,999 |
|
|
|
Input = 9999.90 |
Input = 9999.90 |
Input = 9999.9 |
Output = 9,999.90 |
Output = 9,999.9 |
Output = 9,999.9 |
|
|
|
Input = 9999.09 |
Input = 9999.09 |
Input = 9999.09 |
Output = 9,999.09 |
Output = 9,999.09 |
Output = 9,999.09 |
If you have decimals and you want to see two decimal places, you should use the first format style shown (ZZZ.0Z). With this format style, an input value of 1.1 will yield 1.10.
If you use ZZZ.00 and input 1.1, you will get 1.1. In most cases, the values using format Z will be displayed. However, if you are using Z,ZZZ.0Z format, Z will be suppressed if the Z value contains zero and if the value next to the decimal is suppressed.
The values using the zero (0) format will be displayed unless it is zero. However, the zero will be displayed if it is followed by another decimal position with a format of Z. If there is another decimal position that follows and it has a format of zero (0) and the value is also zero, both zeros will be suppressed along with the decimal. Lastly, if the input value contains more decimal places than the output value, the number will be truncated.
Use the ZeroText option to insert text you define instead of the zero value, if the result is zero.
Add the ZeroText option after the search mask. It should be preceded by a space. Place the text you want to print inside quotation marks and parentheses, as shown in the excerpt.
© Copyright 2012, Oracle and/or its affiliates. All rights reserved. Legal notices.