Template Patterns for Numeric Formatting
Pattern | Description |
---|---|
|
Value with the specified number of digits |
|
Value with leading zeros |
|
Decimal point |
|
Group (thousand) separator |
|
Negative value in angle brackets |
|
Sign anchored to number (uses locale) |
|
Currency symbol (uses locale) |
|
Decimal point (uses locale) |
|
Group separator (uses locale) |
|
Minus sign in specified position (if number < 0) |
|
Plus sign in specified position (if number > 0) |
|
Plus/minus sign in specified position |
|
Roman numeral (input between 1 and 3999) |
|
Ordinal number suffix |
|
Shift specified number of digits (see notes) |
|
Scientific notation (not implemented yet) |
Usage
-
A sign formatted using SG, PL, or MI is not anchored to the number; for example:
- TO_CHAR(-12, 'S9999') produces ' -12'
- TO_CHAR(-12, 'MI9999') produces '- 12'
- 9 results in a value with the same number of digits as there are 9s. If a digit is not available it outputs a space.
- TH does not convert values less than zero and does not convert fractional numbers.
- V effectively multiplies the input values by 10^n, where n is the number of digits following V. TO_CHAR does not support the use of V combined with a decimal point. For example: 99.9V99 is not allowed.