Oracle Number formats
A number format may be used as part a TO_CHAR or TO_DATE function to return a number in the specified format.
| Format | Description |
Example |
| 9 | Number (suppress leading/trailing zeros) Includes a leading - for negative no's or one leading space for pos no's |
9999=' 123' |
| 0 | Number including leading/trailing zeros |
09999=0123 9999D00=123.00 |
| FM | Supress all leading /trailing blanks | FM9999=123 |
| $ | Include a leading $ | $999=$123 |
| B | Over-ride the '0' format and replace leading 0's with blank spaces ' ' | B9999=' 123' |
| S | Include poth positive+ and negative - signs | S999 =+123 999S =123+ |
| PR | Indicate SIGN with <brackets> | PR999=<123> PR999=' 123 ' |
| MI | Indicate Minus SIGN | 999MI=123- |
| RN or rn | Return upper or lower case roman numberal | RN99=XI |
| D | Position of decimal point(.) | 99D99=12.34 |
| G | Group separator (often a comma) in desired position | 9G999=1,234 |
| , | Return a comma in desired position | 9,999=1,234 |
| . | Return a period in desired position | 99.99=12.34 |
| C | ISO currency symbol | C99 |
| L | Local currency symbol | L99 |
Some of the format elements above can only
be used at the start or end of a format string:
MI, PR, S
Related
Date & Character Formats
TO_CHAR
TO_DATE
TO_NUMBER