Re: to_char with locale decimal separator

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: Ingmar Brouns <swingi(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: to_char with locale decimal separator
Date: 2013-07-29 14:51:29
Message-ID: 51F68171.8000400@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/29/2013 07:27 AM, Ingmar Brouns wrote:
> On Mon, Jul 29, 2013 at 3:45 PM, Adrian Klaver <adrian(dot)klaver(at)gmail(dot)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(dot)klaver(at)gmail(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Jenkinson 2013-07-29 14:57:35 Re: Incorrect response code after XA recovery
Previous Message Tom Lane 2013-07-29 14:46:12 Re: Incorrect response code after XA recovery