Currently, the toolset allows only a single edit pattern for a numeric field. In this edit pattern, the user enters specifiers for optional and mandatory digits and leading or trailing signs. Punctuation is treated as literals, which may be changed based on the dialect. These specifiers are, for the most part, the same as defined by the generator, with a few exceptions.
In the toolset, a '+' represents a mandatory sign, and a '-' represents an optional sign. The sign may be leading (preceding all digits) or trailing (following all digits). A mandatory sign specifier means that the sign must always be displayed, even if the value is positive or zero. An optional sign is one where the sign is suppressed if the value is positive or zero, and displayed if the value is negative.
Also, the current implementation defines the '*' and '$' characters to mean special things. The '*' is considered a combination of fill character and optional digit (Z). If significance has not been established, then the '*' is used as the fill character. If significance has been established, then the '*' operates as a digit specifier 9. This behavior is extracted from the old edit pattern and is used to set the edit pattern correctly and to specify the fill character.
The '$' character is used to represent a floating currency symbol or optional digit. Much the same as the '*' character, if significance is not set, then the '$' is replaced by the fill character. This is true for all positions EXCEPT the one just left of the first significant digit, in which case the '$' character is inserted. All other '$' characters after significance start are treated as digit specifiers (9).
The generator translates numeric edit patterns specified using this syntax to either a format 1 or format 2 edit pattern using the new syntax. This conversion process must handle unsigned, mandatory signed, and optional signed patterns, as well as check-protection fill and floating currency symbols.
The rules for conversion of an old format edit pattern to a new pattern are:
The following table illustrates the translation process. The sign of the value determines which picture is used to format the value, resulting in the correct presentation. In the future, the toolset will be enhanced to allow the user direct entry of the positive, negative, and zero edit pattern pictures for numeric values.
|
Old Format Edit Pattern |
Format |
Positive Picture |
Negative Picture |
Fill Character |
Float Prefix Literal |
|---|---|---|---|---|---|
|
ZZZ,ZZ9 |
1 |
ZZZ,ZZ9 |
N/A |
Default |
No |
|
+ZZ9 |
2 |
+ZZ9 |
-ZZ9 |
Default |
No |
|
ZZ9+ |
2 |
ZZ9+ |
ZZ9- |
Default |
No |
|
-ZZ9 |
2 |
ZZ9 |
-ZZ9 |
Default |
No |
|
ZZ9- |
2 |
ZZ9 |
ZZ9- |
Default |
No |
|
***,**9 |
1 |
ZZZ,ZZ9 |
N/A |
* |
No |
|
***,*$9 |
1 |
$ZZZ,ZZ9 |
N/A |
* |
Yes |
|
$**9.99 |
1 |
$ZZ9.99 |
N/A |
* |
No |
|
$$$9.99 |
1 |
$ZZ9.99 |
N/A |
Default |
Yes |
|
+$**9.99 |
2 |
+$ZZ9.99 |
-$ZZ9.99 |
* |
No |
|
$+**9.99 |
2 |
$+ZZ9.99 |
$-ZZ9.99 |
* |
Yes |
|
$$$9.99+ |
2 |
$ZZ9.99+ |
$ZZ9.99- |
Default |
Yes |
|
$**9.99- |
2 |
$ZZ9.99 |
$ZZ9.99- |
* |
No |
|
Copyright © 2013 CA.
All rights reserved.
|
|