Converting Number to Words

I am providing a simple query in Oracle that returns words for the given number.

SQL> select  to_char( to_date(12345,'J'), 'JSP') from dual;

TO_CHAR(TO_DATE(12345,'J'),'JSP')
----------------------------------------
TWELVE THOUSAND THREE HUNDRED FORTY-FIVE

In the above query we first convert Number to Date using format J, which stands for Julian day. The we use format JSP with TO_CHAR() to conver the given date to julian day and spell it as well.

Srikanth


Home    Blogs

Post Your Comment

Your Name :
Your Email Address :
Comment :

Comments


Posted By chaitanya On 29-Jul-09 10:26:58 AM

Nice tip!



Posted By sudha On 29-Jul-09 02:42:29 PM

julian day, a very new term which i have learnt from this post sir.thanku sir.



Posted By praveen On 31-Jul-09 11:08:55 PM

very nice sir...
this will be very much useful in many of the applications and many of us dont know this function. Thanks for providing the tip through this blog..



Posted By Srikanth On 04-Aug-09 09:47:29 AM

Thank you sir. It is very simple and easy.



Posted By sampath On 24-Aug-09 08:36:57 PM

Really very nice tip. i do not no this before. thank you sir..... .we are excepting like these tips more in feature ....



Posted By Avinash On 30-Aug-09 03:44:03 PM

Julian Day (number of days since January 1 4713 BC, where January 1 4713 BC is 1 in Oracle)

JSP stands for Julian dates Spelled

-Avinash



Posted By Mani Kumar On 15-Oct-09 08:16:27 PM

Thank you sir.. for providing a useful query...



Posted By alekhya On 19-Oct-09 03:18:42 PM

its nice...thank u sir..



Posted By sanyasi naidu On 18-Nov-09 01:18:14 PM

nice information



Posted By roshan On 25-Nov-09 11:54:00 AM

hi there it is easy to know ths but there is another way to find this.it gives some result wrong



Posted By k.nagarjuna On 05-Dec-09 09:28:27 AM

sir,
will it work in sql server.



Posted By lokanath On 29-Dec-09 07:36:05 PM

Hi Sir, can you please tell me why we are using Snapshot!!!!



Posted By D V S S N RAJU On 05-Jan-10 07:05:25 PM

great sir, i wrote 100 lines procedure in foxpro yet limited to 99 crores.



Posted By srinivas rao On 08-Mar-10 02:25:23 PM

Very nice.. Really good while writing many applications.