Numeric Data Type Rounding Up

Поиск
Список
Период
Сортировка
От Carlos Mennens
Тема Numeric Data Type Rounding Up
Дата
Msg-id CAAQLLO77urJNRwbP6hyMgyYiFazRqjuoXT6wSUjA3+wTvQ__rQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Numeric Data Type Rounding Up  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Numeric Data Type Rounding Up  (Steve Crawford <scrawford@pinpointresearch.com>)
Список pgsql-novice
I have a table called weight and this table is tracking weight for a
few people in a fitness program that just started. I created the table
as described below:

fitness=# \d weight
                                Table "public.weight"
 Column |         Type          |                      Modifiers
--------+-----------------------+-----------------------------------------------------
 id     | integer               | not null default
nextval('weight_id_seq'::regclass)
 lbs    | numeric(5,0)          | not null
 date   | date                  | not null
 dow    | character varying(9)  | not null
 name   | character varying(50) | not null
Indexes:
    "weight_pkey" PRIMARY KEY, btree (id)

Now when I enter a value in the 'lbs' field / column of '172.80', it
rounds the value up to '173.00'. I looked on the documentation and
found a numeric data type called 'real'. I tried changing the data
type from 'NUMERIC' to 'REAL' but it didn't work. I honestly don't
know if that is even the correct numeric data type I want / need to
show exact values on something like tracking weight figures. Can
someone tell me if I'm way off here?

В списке pgsql-novice по дате отправления:

Предыдущее
От: DrYSG
Дата:
Сообщение: Re: Slow duplicate deletes
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Numeric Data Type Rounding Up