Skip site navigation (1) Skip section navigation (2)

Re: TO_CHAR and Separate thousand

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Paulo Cuellas <paulo(at)ibiz(dot)com(dot)br>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: TO_CHAR and Separate thousand
Date: 2005-11-03 20:11:34
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Paulo Cuellas wrote:
> Hi People,
>     Someone can say if its possible use TO_CHAR to define point "." like 
> separate thousands ?
>     Thank you so much for any help.

Sure, our documentation has a few examples:

	to_char(148.5, '999D999')	' 148,500'
	to_char(3148.5, '9G999D999')	' 3 148,500'

Here, the locale has the thousands separator as space.  I am assuming
your locale is set up with the thousands marker as period.  Are you
asking for the period as the thousands separator even though your locale
isn't set that way?

PostgreSQL 8.1 RC1 also has psql '\pset numericlocale' which outputs all
numerics in locale-specific format, but again that is going to be all
driven by locale.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

pgsql-committers by date

Next:From: Bruce MomjianDate: 2005-11-03 20:19:41
Subject: Re: pgsql: Rename the members of CommandDest enum so
Previous:From: Alvaro HerreraDate: 2005-11-03 20:02:51
Subject: pgsql: Fix one overlooked ocurrence of "None" in EXEC_BACKEND block.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group