Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6F2449FB3AE for ; Tue, 31 Oct 2006 17:18:35 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 32923-06 for ; Tue, 31 Oct 2006 17:18:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id 9B6DD9FB1E1 for ; Tue, 31 Oct 2006 17:18:31 -0400 (AST) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=phlogiston.dydns.org) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1Gf0zs-0000yp-L7 for pgsql-sql@postgresql.org; Tue, 31 Oct 2006 16:18:12 -0500 Received: by phlogiston.dydns.org (Postfix, from userid 1000) id DB7934051; Tue, 31 Oct 2006 16:18:24 -0500 (EST) Date: Tue, 31 Oct 2006 16:18:24 -0500 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Round Numeric Type Message-ID: <20061031211824.GC20809@phlogiston.dyndns.org> References: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55c095e90610311135l101f6a91s433e6d7e5b90cb7c@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/256 X-Sequence-Number: 26645 On Tue, Oct 31, 2006 at 05:35:17PM -0200, Ezequias Rodrigues da Rocha wrote: > Hi list, > > I did a trigger to update a points on a table but in some cases the > PostgreSQL does a round of my Numeric like. > > If >= 0.5 so postgresql puts 1 > If < 0.5 so postgresql puts 0 > > Did anybody knows if it is possible to control this matter ? Sounds like your datatype doesn't match your input, and that you've got a type that rounds. What's the datatype you're putting into? A -- Andrew Sullivan | ajs@crankycanuck.ca Users never remark, "Wow, this software may be buggy and hard to use, but at least there is a lot of code underneath." --Damien Katz