Re: [GENERAL] to_char with locale decimal separator

2013-07-30 Thread Adrian Klaver
On 07/30/2013 08:34 AM, Ingmar Brouns wrote: Thanks for your time, appreciate it! As a dirty alternative, you could also do something like: select translate(5.000::text,'.',substr(to_char(.0),2,1)); Not so nice, but would work. Though I still feel there should be a more elegant of doing this.

Re: [GENERAL] to_char with locale decimal separator

2013-07-30 Thread Ingmar Brouns
On Tue, Jul 30, 2013 at 4:42 PM, Adrian Klaver wrote: > On 07/30/2013 03:03 AM, Ingmar Brouns wrote: >> >> On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote: > > >>> >> >> anyone? Giving a locale corresponding textual representation >> of a numerical value keeping the exact nr of decimal digit

Re: [GENERAL] to_char with locale decimal separator

2013-07-30 Thread Adrian Klaver
On 07/30/2013 03:03 AM, Ingmar Brouns wrote: On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote: anyone? Giving a locale corresponding textual representation of a numerical value keeping the exact nr of decimal digits must be a fairly common use case. Would it be an idea to implement a t

Re: [GENERAL] to_char with locale decimal separator

2013-07-30 Thread Ingmar Brouns
On Mon, Jul 29, 2013 at 3:12 PM, Ingmar Brouns wrote: > On Mon, Jul 29, 2013 at 1:24 PM, Ingmar Brouns wrote: >> Hi, >> >> I need to convert some numerical values to text using the decimal >> separator that corresponds to the current locale. However, I do >> not want to lose information by paddin

Re: [GENERAL] to_char with locale decimal separator

2013-07-29 Thread Adrian Klaver
On 07/29/2013 07:27 AM, Ingmar Brouns wrote: On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver wrote: On 07/29/2013 04:24 AM, Ingmar Brouns wrote: Hi, This work?: test=> select replace(1.500::text, '.', ','); replace - 1,500 (1 row) that would work, but that requires keeping

Re: [GENERAL] to_char with locale decimal separator

2013-07-29 Thread Ingmar Brouns
On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver wrote: > On 07/29/2013 04:24 AM, Ingmar Brouns wrote: >> >> Hi, >> >> I need to convert some numerical values to text using the decimal >> separator that corresponds to the current locale. However, I do >> not want to lose information by padding with

Re: [GENERAL] to_char with locale decimal separator

2013-07-29 Thread Adrian Klaver
On 07/29/2013 04:24 AM, Ingmar Brouns wrote: Hi, I need to convert some numerical values to text using the decimal separator that corresponds to the current locale. However, I do not want to lose information by padding with zero decimals or truncating zero decimals. So I basically want a text ca

Re: [GENERAL] to_char with locale decimal separator

2013-07-29 Thread Ingmar Brouns
On Mon, Jul 29, 2013 at 1:24 PM, Ingmar Brouns wrote: > Hi, > > I need to convert some numerical values to text using the decimal > separator that corresponds to the current locale. However, I do > not want to lose information by padding with zero decimals or > truncating zero decimals. So I basic