Numeric patterns

Specific symbols must be used to create numeric patterns for numeric fields. You can also use these symbols to create numeric patterns for decimal fields.

Note: The dash (-), colon (:), slash (/) and space ( ) are treated as literal values and can be included anywhere in a pattern. To include a phrase in a pattern, delimit the text string with single quotation marks ('). For example, 'Your balance is' z,zz9.99 can be specified as the Display Pattern.

Use these pattern symbols to create patterns. The pattern determines the format for users to enter or format data. The formatted results in the Example column are delimited by double quotation marks so that you can see where spaces would appear in the result. The quotation marks are not part of the result. In these examples, the locale is English (USA).

Numeric symbol

Description

Example

9

Single digit or the zero digit if the input is empty. When following the decimal radix, indicates the exact number of digits as contained in the data value.

Display Pattern: zzz,zz9.999

Input Value: 123456.1236 or 1234

Formatted Value: “123,456.124” or “1,234.000”

z

Single digit or no output if the input is the leading zero digit, or no output if the input is empty

Display Pattern: $zzz9

Input Value: 123

Formatted Value: “$123”

z

Single digit or a space if the input is the leading zero digit, or a space if the input is empty

Display Pattern: $ZZZ9

Input Value: 123

Formatted Value: “$ 123”

s

Minus sign (-) if the number is negative (when the number is positive, no symbol is required)

Display Pattern: $szzz9

Input Value: 123 or -123

Formatted Value: “$123” or “$-123”

S

Minus sign (-) if the number is negative, or a space if the number is positive

Display Pattern: $Szzz9

Input Value: 123 or -123

Formatted Value: “$ 123” or “$-123”

E

Exponential symbol (E+3 means exponent value is 3 and E-2 means exponent value is -2).

The exponential symbol (E) may be used after a 9, z, or Z digit only.

Display Pattern: 99.999E

Input Value: 12345 or 0.12345

Formatted Value: “12.345E+3” or “12.345E-2”

$

Currency symbol, whichever one corresponds to the object’s current Locale setting

Display Pattern: $zzz9

Input Value: 123

Formatted Value: “$123”

cr

Credit symbol (CR) if the number is negative (when the number is positive, no symbol is required)

Display Pattern: cr$zzz9

Input Value: 123 or -123

Formatted Value: “$123” or “CR$123”

CR

Credit symbol (CR) if the number is negative, or spaces if the number is positive

Display Pattern: CR$zzz9

Input Value: 123 or -123

Formatted Value: “ $123” or “CR$123”

db

Debit symbol (DB) if the number is negative (when the number is positive, no symbol is required)

Display Pattern: db$zzz9

Input Value: 123 or -123

Formatted Value: “$123” or “DB$123”

DB

Debit symbol (DB) if the number is negative, or spaces if the number is positive

Display Pattern: DB$zzz9

Input Value: 123 or -123

Formatted Value: “ $123” or “DB$123”

( )

Left and right parenthetic characters to show a negative number. If the number is a positive number, the parenthetic characters become spaces.

Note: The left and right parenthetic characters may enclose an 8, 9, z, or Z digit only.

Display Pattern: ($zzz9)

Input Value: 123 or -123

Formatted Value: “ $123 ” or “($123)”

.

Decimal radix, whichever one corresponds to the object’s current Locale setting

Display Pattern: zzz9.99

Input Value: 123.45

Formatted Value for a German (Germany) locale: “123,45”

v

Implied decimal radix, whichever one corresponds to the object’s current Locale setting (the decimal radix is stripped out before the output is written)

Display Pattern: zzz9v99

Input Value: 123.45

Formatted Value: “12345”

,

Grouping character, whichever one corresponds to the object’s current Locale setting

Display Pattern: z,zz9.99

Input Value: 1234.56

Formatted Value for a German (Germany) locale: “1.234,56”

%

Percentage symbol, whichever one corresponds to the object’s current Locale setting

Display Pattern: z9.99%

Input Value: 0.123

Formatted Value: “12.30%”

Reserved symbols

The following symbols have special meanings and cannot be used as literal text.

Symbol

Description

?

When submitted, the symbol matches any one character. When merged for display, it becomes a space.

*

When submitted, the symbol matches 0 or Unicode white space characters. When merged for display, it becomes a space.

+

When submitted, the symbol matches one or more Unicode white space characters. When merged for display, it becomes a space.

// Ethnio survey code removed