Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 77BC69FB7F8 for ; Tue, 17 Apr 2007 15:54:01 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 13848-02 for ; Tue, 17 Apr 2007 15:53:56 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from rootabega.88thstreet.com (dsl254-071-237.nyc1.dsl.speakeasy.net [216.254.71.237]) by postgresql.org (Postfix) with ESMTP id 37BD19FB7F1 for ; Tue, 17 Apr 2007 15:53:58 -0300 (ADT) Received: from www.88thstreet.com (localhost [IPv6:::1]) by rootabega.88thstreet.com (8.13.3/8.13.3) with ESMTP id l3HIrqug004683 for ; Tue, 17 Apr 2007 14:53:54 -0400 (EDT) Received: from 63.118.86.10 (SquirrelMail authenticated user radhika) by www.88thstreet.com with HTTP; Tue, 17 Apr 2007 14:53:54 -0400 (EDT) Message-ID: <4838.63.118.86.10.1176836034.squirrel@www.88thstreet.com> Date: Tue, 17 Apr 2007 14:53:54 -0400 (EDT) Subject: Floating point type to store numbers From: "Radhika Sambamurti" To: pgsql-sql@postgresql.org Reply-To: radhika@88thstreet.com User-Agent: SquirrelMail/1.4.5 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.138 tagged_above=0 required=5 tests=AWL=0.002, BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200704/150 X-Sequence-Number: 28150 Hi, I am currently using Postgresql to maintain an application which is used for trading and back office operations. Currently our monetary fields are stored in Varchar. I am finding a huge CPU utilization while converting from varchar to float. I think for reasons unknown to me, we originally stored $ amounts and rates in varchar. I am planning to convert our tables that hold money fields and rates from varchar to float. I do not want to convert to numeric because numeric is a special string type. The question is: how accurate is floating point numbers in Postgres. We are using 7.4 soon to be moving to 8.2. I need the accuracy to about 6 decimal points. I have read that floating points can convert to numbers in accurately. Thank you. Radhika -- It is all a matter of perspective. You choose your view by choosing where to stand. Larry Wall ---