Search Postgresql Archives

Re: How to convert numbers into words in postgresql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Jashaswee asked:

> i want to convert numbers into words in postgresql.
> is there any query for it?

Easy enough with PlPerl:

$ sudo apt-get install liblingua-en-inflect-perl

$ createlang plperlu

$ psql <<eot
> create or replace function numwords(int)
>   returns text
>   language plperlu
>   immutable
> as '
> use Lingua::EN::Inflect qw( NUMWORDS );
> return NUMWORDS(shift);
> ';
> eot
CREATE FUNCTION

$ psql -tc 'select numwords(1234)'

 one thousand, two hundred and thirty-four


- -- 
Greg Sabino Mullane greg@xxxxxxxxxxxx
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201305150015
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAlGTDFwACgkQvJuQZxSWSsgpIACgyXX3Bt3SMDje/5V+tzSMESD+
HdsAmwZpYqWgnZeZvmEn8jclUCQzdKTG
=x9DW
-----END PGP SIGNATURE-----




-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux