X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8E06AD1B26E for ; Fri, 23 Jul 2004 10:20:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24989-06 for ; Fri, 23 Jul 2004 13:20:59 +0000 (GMT) Received: from anchor-post-33.mail.demon.net (anchor-post-33.mail.demon.net [194.217.242.91]) by svr1.postgresql.org (Postfix) with ESMTP id 8B20FD1B269 for ; Fri, 23 Jul 2004 10:20:48 -0300 (ADT) Received: from mailgate.bray-healthcare.com ([80.177.250.202] helo=solport.bray-healthcare.com) by anchor-post-33.mail.demon.net with esmtp (Exim 3.35 #1) id 1Bnzyr-000P3G-0X; Fri, 23 Jul 2004 13:20:57 +0000 Received: from [192.168.1.18] (helo=braydb.bray-healthcare.com) by solport.bray-healthcare.com with esmtp (Exim 3.36 #1 (Debian)) id 1Bnzyq-0007ex-00; Fri, 23 Jul 2004 14:20:56 +0100 Subject: Re: HELP ! With Money type From: Oliver Elphick Reply-To: olly@lfix.co.uk To: Terry Hampton Cc: pgsql-admin@postgresql.org In-Reply-To: <41010659.90908@limacorp.com> References: <41010659.90908@limacorp.com> Content-Type: text/plain Message-Id: <1090588843.1560.3.camel@braydb> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 23 Jul 2004 14:20:43 +0100 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=US_DOLLARS_3 X-Spam-Level: X-Archive-Number: 200407/270 X-Sequence-Number: 14338 On Fri, 2004-07-23 at 13:36, Terry Hampton wrote: > > Everyone, > > Just ran across an odd situation. > I have defined a field: > > amount | money | not null default '' > > Works fine until the dollar amounts get > very large - into the tens of millions. > At that point, the actual amount stored > becomes very unpredictable. > > I just saved a record via a simple > front end App. I entered 56,000,000 > When I retrieved the record i got: > $13,050,327.04 !! > > Any thoughts ? The Money type is deprecated. It uses a floating point representation, which is not good for precise values. Use DECIMAL instead - e.g. DECIMAL(12,2)