Skip to content

Formatting bigdecimals sql oracle

To have a readable big numbers under oracle and to facilatet the reading, I’m looking for a way to add blank space to obtain something like that:

213537592384.236 ===> 213 537 592 384.236

The problem that I have big numbers like above.



Spaces are a curious separator, and not directly supported by to_char(). However, you can format with commas and then replace the commas with spaces:

select replace(to_char(12345678.123, '999,999,999,999,999,999.999'), ',', ' ')
from dual
User contributions licensed under: CC BY-SA
5 People found this is helpful