Re: How to convert numbers into words in postgresql - Mailing list pgsql-general

From Julian
Subject Re: How to convert numbers into words in postgresql
Date
Msg-id 5192C022.9070102@internode.on.net
Whole thread Raw
In response to Re: How to convert numbers into words in postgresql  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-general
On 15/05/13 08:27, Merlin Moncure wrote:
> On Tue, May 14, 2013 at 5:24 PM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
>> On 05/14/2013 03:17 PM, John R Pierce wrote:
>>>
>>> On 5/14/2013 2:57 PM, Alvaro Herrera wrote:
>>>>
>>>> Jashaswee escribió:
>>>>>
>>>>>> i want to convert numbers into words in postgresql.is there any
>>>>> query for it?
>>>>>> if yes please reply soon
>>>>
>>>> Try cash_words()
>>>
>>>
>>>
>>> um, where is that documented?  I've searched the various 'functions'
>>> pages, and not seen it, nor is it in the manual Index.
>>
>>
>>
>> production=> \df cash_words
>>                              List of functions
>>    Schema   |    Name    | Result data type | Argument data types |  Type
>> ------------+------------+------------------+---------------------+--------
>>  pg_catalog | cash_words | text             | money               | normal
>>
>> Seems to only work with money type.
>
> from the source:
> /* cash_words()
>  * This converts a int4 as well but to a representation using words
>  * Obviously way North American centric - sorry
>  */
> Datum
> cash_words(PG_FUNCTION_ARGS)
> {
>
> so, it comes down to the money type is one of the more bizarre things
> left from postgres past and we try not to advertise too loudly I
> suppose.
>
> merlin
>
>
What the?
I currently use a python number to words module (n2w.py if OP is
interested in it, let me know). I've been using this for years and never
knew about the cash_words() function, what other secret functions does
postgres have? :)
Now there is a use for the money type, perhaps this function could be
upgrade to not need it?

jules.


pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: How to convert numbers into words in postgresql
Next
From: Adrian Klaver
Date:
Subject: Re: How to convert numbers into words in postgresql