Re: set decimal point in SQL

From: Rodger Donaldson <rodgerd(at)diaspora(dot)gen(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: set decimal point in SQL
Date: 2003-06-18 19:02:16
Message-ID: 20030618190216.GA549@diaspora.gen.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)diaspora(dot)gen(dot)nz
I don't mind straight people, as long as they act gay in public

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jeff Eckermann 2003-06-18 19:13:49 Re: set decimal point in SQL
Previous Message Rod Taylor 2003-06-18 16:27:06 Re: comparing querys