From: Rodger Donaldson <rodgerd@diaspora.gen.nz>
To: pgsql-sql@postgresql.org
Subject: Re: set decimal point in SQL
Date: Thu, 19 Jun 2003 07:02:16 +1200
Message-ID: <20030618190216.GA549@diaspora.gen.nz> (raw)
In-Reply-To: <B0D78FC4B536D6118D5A006097B658DE2A2C45@PCGSSU2>
References: <B0D78FC4B536D6118D5A006097B658DE2A2C45@PCGSSU2>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: rodgerd@diaspora.gen.nz
Subject: Re: set decimal point in SQL
In-Reply-To: <20030618190216.GA549@diaspora.gen.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox