Re: Reports 2.5: Spelling out cash amounts

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: 1997/10/29
Message-ID: <3457ae3b.25671884_at_newshost>#1/1


On 29 Oct 1997 20:27:22 GMT, "D Morrow" <morrowd_at_ci.portsmouth.va.us> wrote:

>Has anyone developed a report using Reports 2.5 that spells out the cash
>amounts on checks? I have seen an example in the Reports manual that talks
>about using a lookup table. Has anyone implemented this lookup table? How
>are you handling this?
>
>Any help will be greatly appreciated.
>
>Thanks,
>Donna

You can use a date function to do this....

  1* select to_char( to_date(5373484,'J'),'Jsp') from dual SQL> /   TO_CHAR(TO_DATE(5373484,'J'),'JSP')



Five Million Three Hundred Seventy-Three Thousand Four Hundred Eighty-Four  

This will work for numbers between 1 and 5,373,484...

You can take it a step further to support numbers -5,373,484 .. 5,373,484 by

select decode( sign( :N ), -1, 'Negative ', 0, 'Zero', NULL ) ||

       decode( sign( abs(:N) ), +1, to_char( to_date( abs(:N),'J'),'Jsp') ) from dual
/  

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Bethesda MD  

http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

NOTICE: In order to cut down on the amount of time I spend applying silly logic to email addresses like "In order to cut down on spam, remove THIS from my email" or "In order to cut down on spam, reverse my email address", etc, I will simply hit delete when that mail bounces back to me, which is what I do with spam myself.  

I haven't figured out whats more time consuming for me, deleting spam or resending emails after re-reading the whole thing to figure out the algorithm to apply. Received on Wed Oct 29 1997 - 00:00:00 CET

Original text of this message