Skip to Main Content
  • Questions
  • Formatting numeric fields with TO_CHAR

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, neha.

Asked: June 19, 2016 - 9:14 am UTC

Last updated: June 20, 2016 - 12:40 am UTC

Version: oracle 10.1.2

Viewed 1000+ times

You Asked

I need to get 20,00 instead of 20.00 by using to_char(20,'99.99').I had replaced decimal point with comma but iam unable to do .can any one help me with this?

and Connor said...

SQL> select to_char(20,'99D99','NLS_NUMERIC_CHARACTERS = '',.''') from dual;

TO_CHA
------
 20,00


"D" represents "use the decimal point character", and the third to_char parameters let me override what I want to use.

Is this answer out of date? If it is, please let us know via a Comment