Re: numeric to text (7.3)

From: Joel Burton <joel(at)joelburton(dot)com>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Szima Gábor <sygma(at)tesla(dot)hu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: numeric to text (7.3)
Date: 2002-12-02 19:03:38
Message-ID: 20021202190338.GB13254@temp.joelburton.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 02, 2002 at 01:35:47PM -0500, Rod Taylor wrote:
> > template1=# select text(2.000::numeric);
> > text
> > -------
> > 2.000
> > (1 row)
> >
> > The text(numeric) function doesn't round numbers. :(
> >
> > This is bug or feature? :)
>
> I'd say feature in that it doesn't reduce the precision of the number.

... and, of course, you can round with:

joel(at)joel=# select round('2.000'::numeric);
round
-------
2
(1 row)

joel(at)joel=# select round('2.000'::numeric,2);
round
-------
2.00
(1 row)

--

Joel BURTON | joel(at)joelburton(dot)com | joelburton.com | aim: wjoelburton
Independent Knowledge Management Consultant

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rod Taylor 2002-12-02 19:08:24 Re: ALTER TABLE schema SCHEMA TO new_schema?
Previous Message Rod Taylor 2002-12-02 18:35:47 Re: numeric to text (7.3)