Re: numeric to text (7.3) - Mailing list pgsql-hackers

From Joel Burton
Subject Re: numeric to text (7.3)
Date
Msg-id 20021202190338.GB13254@temp.joelburton.com
Whole thread Raw
In response to Re: numeric to text (7.3)  (Rod Taylor <rbt@rbt.ca>)
Responses Re: numeric to text (7.3)
List 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@joel=# select round('2.000'::numeric);round
-------     2
(1 row)

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

-- 

Joel BURTON  |  joel@joelburton.com  |  joelburton.com  |  aim: wjoelburton
Independent Knowledge Management Consultant


pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: numeric to text (7.3)
Next
From: Rod Taylor
Date:
Subject: Re: ALTER TABLE schema SCHEMA TO new_schema?