When you use the TO_CHAR()
function to format a number in Oracle, you use a format model to determine how the number should be formatted.
For example, you could format a number like 12,345.00
or like 12.345,00
, depending on your locale.
The format model can include the G
or D
format elements to add a comma to a number. Which one you use depends on whether you want the comma as a thousands separator, or as a decimal character.
Alternatively, you can use an actual comma character (,
) if you prefer, although this method is not locale aware like the G
and D
format elements are.