X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 23DD530DE82 for ; Wed, 18 Jun 2003 19:02:44 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 04898-08 for ; Wed, 18 Jun 2003 16:02:33 -0300 (ADT) Received: from israel.diaspora.gen.nz (israel.diaspora.gen.nz [202.50.109.65]) by svr1.postgresql.org (Postfix) with ESMTP id 3BD2730DD70 for ; Wed, 18 Jun 2003 16:02:33 -0300 (ADT) Received: from rodgerd by israel.diaspora.gen.nz with local (Exim 3.35 #1 (Debian)) id 19SiCG-00009N-00; Thu, 19 Jun 2003 07:02:16 +1200 Date: Thu, 19 Jun 2003 07:02:16 +1200 To: pgsql-sql@postgresql.org Subject: Re: set decimal point in SQL Message-ID: <20030618190216.GA549@diaspora.gen.nz> Reply-To: rodgerd@diaspora.gen.nz References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i From: Rodger Donaldson X-Archive-Number: 200306/223 X-Sequence-Number: 13981 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