Re: Changing point for commas and commas for point

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Changing point for commas and commas for point
Date: 2007-01-21 18:49:47
Message-ID: 28242.1169405387@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

"Ezequias Rodrigues da Rocha" <ezequias(dot)rocha(at)gmail(dot)com> writes:
> Here in my country (Brazil) we have the decimal simbol as ' , ' (commas) and
> thousand separator as ' . ' (point)

> Here my sql uses: to_char(sum(My_column), '99990D00')

That's the right thing.

> Is there any way to make this happens ?

I think you forgot to set LC_NUMERIC.

regression=# select to_char(42.45, '99990D00');
to_char
-----------
42.45
(1 row)

regression=# set lc_numeric TO 'pt_PT.iso88591';
SET
regression=# select to_char(42.45, '99990D00');
to_char
-----------
42,45
(1 row)

The specific locale names available vary across OSes ... try "locale -a"
for a list.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2007-01-21 18:56:51 Re: Changing point for commas and commas for point
Previous Message Ezequias Rodrigues da Rocha 2007-01-21 18:41:15 Changing point for commas and commas for point