On 03/07/2012 08:50 AM, Carlos Mennens wrote:
> I have a table...
> Table "public.weight"
> Column | Type | Modifiers
> --------+-----------------------+-----------------------------------------------------
> ...
> lbs | numeric(5,0) | not null
> ...
> Now when I enter a value in the 'lbs' field / column of '172.80', it
> rounds the value up to '173.00'.
You specified a precision of 0. Try 2 (if you really want to track to
the 100th of a pound) or 1 for 1/10 pound. numeric(5,2) will be good up
to 999.99 pounds.
steve=# select 123.45::numeric(5,0);
numeric
---------
123
steve=# select 123.45::numeric(5,1);
numeric
---------
123.5
steve=# select 123.45::numeric(5,2);
numeric
---------
123.45
Cheers,
Steve