Re: Localization trouble

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Chris Travers <chris(at)travelamericas(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Localization trouble
Date: 2007-07-06 00:48:55
Message-ID: 20070706004855.GA33620@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jul 05, 2007 at 05:10:57PM -0700, Chris Travers wrote:
> I am trying to find a way to select the number format at runtime for
> textual representation of numbers. I am currently running 8.1.4 built
> from source on Fedora Linux core 5.
>
> I have been trying to use set lc_numeric = various country codes (for
> example es_EC), but I am not able to get the format to change from 1.00
> to 1,00.

I think you'll need to use to_char():

test=> set lc_numeric to 'es_ES.UTF-8';
SET
test=> select to_char(1.234, '9D999');
to_char
---------
1,234
(1 row)

The file src/backend/utils/adt/pg_locale.c in the PostgreSQL source
code has comments about how various LC_* settings are used in the
backend.

--
Michael Fuhr

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2007-07-06 01:15:02 Re: Localization trouble
Previous Message Michael Glaesemann 2007-07-06 00:47:38 Re: Localization trouble