Numbers to words!!!

A simple way of spelling out numbers to words. This could be handy for printing reciepts, cheques etc.

KDE>select to_char( to_date( abs(&num),'J'),'Jsp') "NUMBER TO TEXT" from dual
  2  /
Enter value for num: 345
old   1: select to_char( to_date( abs(&num),'J'),'Jsp') "NUMBER TO TEXT" from dual
new   1: select to_char( to_date( abs(345),'J'),'Jsp') "NUMBER TO TEXT" from dual

NUMBER TO TEXT
------------------------
Three Hundred Forty-Five

Or You can use it on a column like

SELECT sal, TO_CHAR(TO_DATE(sal,'j'), 'jsp') FROM emp;

800.00        eight hundred
2,850.00     two thousand eight hundred fifty
2,450.00     two thousand four hundred fifty
5,000.00     five thousand
3,000.00     three thousand
2,975.00     two thousand nine hundred seventy-five
1,250.00     one thousand two hundred fifty

hope this helps…

Leave a Comment