Re: Localization trouble

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Localization trouble
Дата
Msg-id 20070706004855.GA33620@winnie.fuhr.org
обсуждение исходный текст
Ответ на Localization trouble  (Chris Travers <chris@travelamericas.com>)
Ответы Re: Localization trouble  (Chris Travers <chris@travelamericas.com>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Glaesemann
Дата:
Сообщение: Re: Localization trouble
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: Localization trouble