Fwd: [GENERAL] Convert number to string

2015-09-24 Thread Francisco Olarte
Forgot replying to all, forwarding to the list, sorree for the potential dupes. Hi Hengky: On Thu, Sep 24, 2015 at 10:09 AM, Hengky Liwandouw wrote: > > I don’t have any idea how can I use postgres function to convert series of > number (currency) to my own string.

[GENERAL] Convert number to string

2015-09-24 Thread Hengky Liwandouw
Hi, I don't have any idea how can I use postgres function to convert series of number (currency) to my own string. My string : F G H I J K L M N as the replacement for number : 1 2 3 4 5 6 7 8 9 Dozens = O Hundreds = P Thousands = C Ten thousands = B So. 200 = GP 2000

Re: [GENERAL] Convert number to string

2015-09-24 Thread John R Pierce
On 9/24/2015 1:09 AM, Hengky Liwandouw wrote: Hi, I don’t have any idea how can I use postgres function to convert series of number (currency) to my own string. My string : F G H I J K L M N as the replacement for number : 1 2 3 4 5 6 7 8 9 Dozens = O Hundreds = P Thousands =

Re: [GENERAL] Convert number to string

2015-09-24 Thread Francisco Olarte
HI Melvin: On Thu, Sep 24, 2015 at 2:51 PM, Melvin Davidson wrote: > Postgresql has a translate function: > ​Did you read the ( quoted at the bottom of the reply you sent ) message you were replying to? It contained a working sample using exactly this translate.​ ;-> > >

Re: [GENERAL] Convert number to string

2015-09-24 Thread Melvin Davidson
Postgresql has a translate function: So you can create a pgsql function that A;: converts the numeric to text: txtnum := 12345::text B, Translate it. eg: transnum := SELECT translate(txtnum, '123456789', 'FGHIJKLMN'); eg SELECT translate('31241', '12345', 'FGHIJ'); = HFGIF You would then need