Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: numeric to fully-written-numbers pl/sql translator

Re: numeric to fully-written-numbers pl/sql translator

From: Jan-Marcel <jan-marcel_at_wau.mis.ah.nl>
Date: Tue, 15 Jun 1999 07:33:47 GMT
Message-ID: <FDCyCD.5BC@ahisinfr.xs4all.nl>

Thomas Kyte heeft geschreven in bericht <376e20e8.12358951_at_newshost.us.oracle.com>...
>A copy of this was sent to "Guy Hendrickx" <Guy_at_Cereus.BE>
>(if that email address didn't require changing)
>On Mon, 14 Jun 1999 17:20:12 +0200, you wrote:
>
>>Hi,
>>I'm looking for a pl/sql procedure which is capable of translating
>>a numeric value to a full-text string :
>>ex. '20' will become 'twenty'.
>>If possible it should be available for Ducth, French and English.
>>If only one of the above languages is supported, I'm still interested.
>>Kind regards,
>>Guy Hendrickx
>>Guy_at_Cereus.BE
>>
>
>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
>/
>
>should be international already (language support)

>See http://www.oracle.com/ideveloper/ for my column 'Digging-in to
Oracle8i'...
>Mirrored (and more current) at http://govt.us.oracle.com/~tkyte/
>
>Current article is "Fine Grained Access Control", added June 8'th
>
>Thomas Kyte tkyte_at_us.oracle.com
>Oracle Service Industries Reston, VA USA
>--
>Opinions are mine and do not necessarily reflect those of Oracle
Corporation

Hi Guy,

I'm sorry I have to disappoint you.
Unfortunately the format mask 'JSP' is not influenced by the nls_date_language. It always returns in English. However you can use the nls_date_language in combination with other date format masks.

Good luck,

Jan-Marcel Received on Tue Jun 15 1999 - 02:33:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US