Re: Number to Words Conversion

Поиск
Список
Период
Сортировка
От Yogesh Arora
Тема Re: Number to Words Conversion
Дата
Msg-id 116685ec0711020131i469227bcm134f705ee1a2b651@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Number to Words Conversion  ("Moiz Kothari" <moizpostgres@gmail.com>)
Список pgsql-general
Hi,

   As i am Working for Decimal Formats.....  is there any method to do it in the same way.


On 11/2/07, Moiz Kothari < moizpostgres@gmail.com> wrote:
Hi,

You can use what bruce has suggested and get the value you want.

eg.

select trim(substring(cash_words('1520'), 1, position('dollars' in cash_words('1520'))-1));

will return you

One thousand five hundred twenty (But ofcourse this eg. does not work for decimals)

Regards,
Moiz Kothari

On 11/2/07, Bruce Momjian < bruce@momjian.us> wrote:
yogesh wrote:
> Hello Frnds,
>
> Is there any way to Convert the Number to its equivalent String
> ( Words)
>
>  e.g. 10 to TEN. Urgent require the Answer..

We have cash_words:

        test=> SELECT cash_words('100');
                     cash_words
        ------------------------------------
         One hundred dollars and zero cents
        (1 row)

but that is money-oriented.

--
  Bruce Momjian  < bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://postgres.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings



--
Hobby Site : http://dailyhealthtips.blogspot.com



--
Best Regards,
Yogesh Arora

В списке pgsql-general по дате отправления:

Предыдущее
От: Abandoned
Дата:
Сообщение: Copy the database..
Следующее
От: Bill Moran
Дата:
Сообщение: Re: Postgresql simple query performance question