pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Changing point for commas and commas for point
3+ messages / 3 participants
[nested] [flat]

* Changing point for commas and commas for point
@ 2007-01-21 18:41 Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
  2007-01-21 18:49 ` Re: Changing point for commas and commas for point Tom Lane <tgl@sss.pgh.pa.us>
  2007-01-21 18:56 ` Re: Changing point for commas and commas for point Andreas Kretschmer <akretschmer@spamfence.net>
  0 siblings, 2 replies; 3+ messages in thread

From: Ezequias Rodrigues da Rocha @ 2007-01-21 18:41 UTC (permalink / raw)
  To: pgsql-sql

Hi list,

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')

Is there any way to make this happens ?

Regards

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
                                  Atenciosamente (Sincerely)
                        Ezequias Rodrigues da Rocha
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
A pior das democracias ainda é melhor do que a melhor das ditaduras
The worst of democracies is still better than the better of dictatorships
http://ezequiasrocha.blogspot.com/

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Changing point for commas and commas for point
  2007-01-21 18:41 Changing point for commas and commas for point Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
@ 2007-01-21 18:49 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2007-01-21 18:49 UTC (permalink / raw)
  To: Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>; +Cc: pgsql-sql

"Ezequias Rodrigues da Rocha" <ezequias.rocha@gmail.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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Changing point for commas and commas for point
  2007-01-21 18:41 Changing point for commas and commas for point Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
@ 2007-01-21 18:56 ` Andreas Kretschmer <akretschmer@spamfence.net>
  1 sibling, 0 replies; 3+ messages in thread

From: Andreas Kretschmer @ 2007-01-21 18:56 UTC (permalink / raw)
  To: pgsql-sql

Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com> schrieb:

> Hi list,
> 
> 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')
> 
> Is there any way to make this happens ?

I think, you can use the 'G' as a group separator for this:

test=*# select to_char(12345.67, '999G990D00');
   to_char
-------------
   12.345,67
(1 row)


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."    (unknow)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-01-21 18:56 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-01-21 18:41 Changing point for commas and commas for point Ezequias Rodrigues da Rocha <ezequias.rocha@gmail.com>
2007-01-21 18:49 ` Tom Lane <tgl@sss.pgh.pa.us>
2007-01-21 18:56 ` Andreas Kretschmer <akretschmer@spamfence.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox