Re: set decimal point in SQL

Поиск
Список
Период
Сортировка
От Rodger Donaldson
Тема Re: set decimal point in SQL
Дата
Msg-id 20030618190216.GA549@diaspora.gen.nz
обсуждение исходный текст
Ответ на set decimal point in SQL  ("Bu, Ning" <NBU@pcgus.com>)
Ответы Re: set decimal point in SQL  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-sql
On Mon, Jun 16, 2003 at 05:02:34PM -0500, Bu, Ning wrote:

> I have a field set up as money and I try to calculate some number
> and put in this field, but the number will be 6 demical point and I
> want to cut it to only 2-4 decimal point, how can I do it? Thanks

round(); eg

select    round(foo, 2)
from    bar

...will give you values in column foo rounded to 2 decimal places.

-- 
Rodger Donaldson        rodgerd@diaspora.gen.nz
I don't mind straight people, as long as they act gay in public


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

Предыдущее
От: "Bu, Ning"
Дата:
Сообщение: set decimal point in SQL
Следующее
От: Jeff Eckermann
Дата:
Сообщение: Re: set decimal point in SQL