oracle - Number formatting in SQL -


i have number needs formatted this:

  • thousands need separated .
  • decimals need separated ,

for example, number 1,234,567.89 needs 1.234.567,89.

is there way can simple sql function or have make own function?

use to_char() specification want use , decimal separator , . thousands separator (which not default in oracle)

select to_char(1234567.89, '9g999g999g999d00', 'nls_numeric_characters = '',.''') dual; 

results in: 1.234.567,89

details format models: http://docs.oracle.com/cd/e11882_01/server.112/e41084/sql_elements004.htm#sqlrf00211

details to_char() function: http://docs.oracle.com/cd/e11882_01/server.112/e41084/functions201.htm#sqlrf51882


Comments