Re: to_char with locale decimal separator - Mailing list pgsql-general

From Adrian Klaver
Subject Re: to_char with locale decimal separator
Date
Msg-id 51F68171.8000400@gmail.com
Whole thread Raw
In response to Re: to_char with locale decimal separator  (Ingmar Brouns <swingi@gmail.com>)
List pgsql-general
On 07/29/2013 07:27 AM, Ingmar Brouns wrote:
> On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver <adrian.klaver@gmail.com> 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 track of which decimal
> separator to use yourself.  If you change the locale, the code
> has to change as well. As to_char already converts the decimal
> separator in a locale aware manner, I wonder whether there is a
> way to do this using the existing locale facilities.

Sorry, I just got to your second post where you explained that. I can't
think of a way at the moment.

>
> Ingmar
>
>


--
Adrian Klaver
adrian.klaver@gmail.com


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Incorrect response code after XA recovery
Next
From: John DeSoi
Date:
Subject: 5 is not a smallint but '5' is