Re: How to convert numbers into words in postgresql

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: How to convert numbers into words in postgresql
Date: 2013-05-14 22:27:46
Message-ID: CAHyXU0yS_1rFuBDab+mJUOV+qeOk=wEaGURwHC2aoeRHewnxuQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 14, 2013 at 5:24 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Angelico 2013-05-14 22:31:43 Re: Storing Special Characters
Previous Message Adrian Klaver 2013-05-14 22:24:26 Re: How to convert numbers into words in postgresql