ORACLE NUMBER FORMAT MODELS for TO_CHAR#
This table lists the number format elements. You can use any combination of these elements as the format argument of the TO_CHAR function.Parameter | Example | Explanation |
---|---|---|
9 | ‘9999’ | Number of “9”s determines the length of the returned character |
0 | ‘0999’ | Prefixes value with leading zeroes |
$ | ‘$9999’ | Prefixes value with a dollar sign |
B | ‘B9999’ | Returns zero value as a blank, instead of as 0 |
MI | ‘9999MI’ | Returns ‘-‘ after negative values. Note that by default, a space is left in front of any number value converted to character, to allow for the possibility of a negative sign. |
S | ‘S9999’ | Returns ‘+’ for positive values and ‘-‘ for negative values. |
PR | ‘9999PR’ | Returns negative values in <angle brackets>. |
, | ‘9,999’ | Returns a comma in this position (Thousands separator) |
. | ’99.99’ | Returns a period in this position. (Decimal point) |
V or v | ‘999V99’ | Returns the value by 10n where n is the number of “9”s after the “V” (implied decimal point) |
RN or rn | RN | Upper or lowercase Roman numerals (for integers in range 1 ..3999) |