Received: from summersault.com (nollie.summersault.com [208.196.32.199]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3HFVmu55759 for ; Tue, 17 Apr 2001 11:31:49 -0400 (EDT) (envelope-from mark@summersault.com) Received: (qmail 96570 invoked from network); 17 Apr 2001 15:31:44 -0000 Received: from hoobella.summersault.com (HELO summersault.com) (208.196.32.195) by nollie.summersault.com with SMTP; 17 Apr 2001 15:31:44 -0000 Message-ID: <3ADC61E0.93E7865D@summersault.com> Date: Tue, 17 Apr 2001 10:31:49 -0500 From: Mark Stosberg Reply-To: mark@summersault.com Organization: Summersault X-Mailer: Mozilla 4.77 (Macintosh; U; PPC) X-Accept-Language: en,pdf MIME-Version: 1.0 To: Peter Eisentraut CC: pgsql-sql@postgresql.org Subject: Re: function to format floats as money? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200104/269 X-Sequence-Number: 2620 Peter Eisentraut wrote: > > Mark Stosberg writes: > > > I'm curious to know if there is a function available in Postgres 7.0.3 > > (or 7.1) that will format a float style number as "money". I understand > > that the money type is going away in the future, so using a float type > > that is sometimes formatted like money seems like a good alternative. So > > ideally, I'm looking for a solution that won't go away when the money type > > does. :) Thanks! > > to_char() for formatting. > > numeric for storage. > > Using floats for monetary amounts is not only an extremely bad idea > because of the inexactness of storage and arithmetic, it might even be > illegal if you're using it for official purposes. Thanks Peter. So if the money type is going away, and floats can be illegal, whats the best way to store money? -mark personal website } Summersault Website Development http://mark.stosberg.com/ { http://www.summersault.com/