Understanding Format Notation
Stored and display formats are defined by strings that contain lexical, literal, and meta characters:
-
Lexical characters delimit character expressions and designate interpretation rules.
-
Literal characters represent only themselves.
-
Meta characters represent a class of characters.
Use the format symbols in the following tables to create the format notation for your own custom field formats:
| Meta Symbol | Description |
|---|---|
|
# |
Digit placeholder. If the number has more digits to the right of the decimal point than there are # symbols to the right in the format, the system truncates the number to as many decimal places as there are # symbols to the right. If the number has more digits to the left of the decimal point than there are # symbols to the left in the format, the system displays the extra digits. If the number has fewer digits to the right of the decimal point than there are # symbols to the right of the decimal point in the format, the system adds spaces. If the number has fewer digits to the left of the decimal point than # symbols to the left of the decimal point in the format, the system also adds spaces. Example format: ###.## Input: 1234.567 - Matches? Yes - Output: 1234.56 |
|
0 (zero) |
Digit placeholder. Follows the same rules as for #, except that if the number has fewer digits than there are 0s in the format, the system displays the extra 0s. Example format: 000.00 Input: 1.2345 - Matches? Yes - Output: 001.23 |
|
(period) |
Decimal point. This symbol determines how many digits (0 or #) appear to the right and left of the decimal point. If the format contains only # symbols to the left of this symbol, numbers less than one appear with a decimal point. This symbol has meaning only in conjunction with the # and 0 symbols. Example format: ###.## Input: .12345 - Matches? Yes - Output: .12 |
|
9 |
Required numeric placeholder. If the number does not have the same number of digits as there are 9s, the system displays an error message. Example format: 999 Input: 123 - Matches? Yes - Output: 123 Input: 12 - Matches? No |
|
A |
Matches any alphabetic character: A− Z or a−z. Example format: AA Input: Sd - Matches? Yes - Output: Sd Input: 4A - Matches? No |
|
Z |
Matches any alphabetic or numeric value: A−Z, a−z, or 0−9. Example format: ZZ Input: 3g - Matches? Yes - Output: 3g Input: A3C - Matches? No |
|
@ |
Matches any character. Example format: @@@ Input: 1q? - Matches? Yes - Output: 1q? |
| Lexical Symbol | Description |
|---|---|
|
* |
Matches zero or more occurrences of this character expression. Example format: a*b Input: b - Matches? Yes - Output: b Input: ab - Matches? Yes - Output: ab Input: aab - Matches? Yes - Output: aab |
|
+ |
Matches occurrences of this character expression. Example format: a+b Input: b - Matches? No Input: ab - Matches? Yes - Output: ab Input: aab - Matches? Yes - Output: aab |
|
[ ] |
Denotes a character expression that matches the input character if the input character is the same as any character in the list enclosed by square brackets. If the expression matches, the input character appears. The system interprets all characters enclosed in square brackets as literal characters. Example format: [ab]c Input: ac - Matches? Yes - Output: ac Input: bc - Matches? Yes - Output: bc |
|
{ } |
Denotes a character expression that matches the input character if the input character matches any character in the list enclosed by curly braces. If the expression matches, the first character in the list (not the input character) is copied to output. All characters enclosed in curly braces are interpreted as literal characters. Example format: {ab}c Input: ac - Matches? Yes - Output: ac Input: bc - Matches? Yes - Output: ac |
|
? |
This expression is optional. It is copied to output only if it appeared in input. Example format: a?b Input: ab - Matches? Yes - Output: ab Input: b - Matches? Yes - Output: b |
|
! |
This expression is optional. It is copied to output regardless of whether or not it is matched. Example format: a!b Input: ab - Matches? Yes - Output: ab Input: b - Matches? Yes - Output: ab |
|
~ |
This expression is optional. It is copied to output regardless of whether or not it is matched. Example format: a~b Input: ab - Matches? Yes - Output: b Input: b - Matches? Yes - Output: b |
|
\ |
Example format: a\?b Input: ab - Matches? No Input: a?b - Matches? Yes - Output: a?b |
|
( ) |
Groups expressions. Example format: (abc)!99 Input: abc12 - Matches? Yes - Output: abc12 Input: 12 - Matches? Yes - Output: abc12 |