Re: Formatting numbers in psql? - Mailing list pgsql-general

From Karel Zak
Subject Re: Formatting numbers in psql?
Date
Msg-id 20020927161650.B12011@zf.jcu.cz
Whole thread Raw
In response to Formatting numbers in psql?  (Holger Marzen <holger@marzen.de>)
List pgsql-general
On Thu, Sep 26, 2002 at 10:52:11PM +0200, Holger Marzen wrote:
> Hi *,
>
> can I format numbers in psql output with decimal separators, say 1234567
> will be displayed as 1.234.567 or 1,234,567?

 G = group by locale
 D = decimal point be locale

test=# select to_char(123456789.012, '999G999G999D999');
     to_char
------------------
  123 456 789,012
(1 row)


 - on locale independent:

test=# select to_char(123456789.012, '999,999,999.999');
     to_char
------------------
  123,456,789.012
(1 row)

    Karel

--
 Karel Zak  <zakkr@zf.jcu.cz>
 http://home.zf.jcu.cz/~zakkr/

 C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

pgsql-general by date:

Previous
From: Neil Conway
Date:
Subject: Re: 7.0 -> 7.2 Migration (oops)
Next
From: Andriy Tkachuk
Date:
Subject: Re: query speed depends on lifetime of frozen db?