Re: How useful is the money datatype?
От
Rich Shepard
Тема
Re: How useful is the money datatype?
Дата
Msg-id
alpine.LNX.2.00.0910040924050.10010@salmo.appl-ecosys.com
Ответ на
Re: How useful is the money datatype? (Sam Mason)
Список
Дерево обсуждения
How useful is the money datatype? Thom Brown <thombrown@gmail.com>
Re: How useful is the money datatype? Peter Eisentraut <peter_e@gmx.net>
Re: How useful is the money datatype? Raymond O'Donnell <rod@iol.ie>
Re: How useful is the money datatype? Thom Brown <thombrown@gmail.com>
Re: How useful is the money datatype? Filip Rembiałkowski <plk.zuber@gmail.com>
Re: How useful is the money datatype? Peter Geoghegan <peter.geoghegan86@gmail.com>
Re: How useful is the money datatype? Grzegorz Jaśkiewicz <gryzman@gmail.com>
Re: How useful is the money datatype? Greg Stark <gsstark@mit.edu>
Re: How useful is the money datatype? Raymond O'Donnell <rod@iol.ie>
Re: How useful is the money datatype? Sam Mason <sam@samason.me.uk>
Re: How useful is the money datatype? Merlin Moncure <mmoncure@gmail.com>
Re: How useful is the money datatype? Sam Mason <sam@samason.me.uk>
Re: How useful is the money datatype? "V S P" <pgsql-general@postgresql.org>
Re: How useful is the money datatype? Sam Mason <sam@samason.me.uk>
Re: How useful is the money datatype? Craig Ringer <craig@postnewspapers.com.au>
Re: How useful is the money datatype? Rich Shepard <rshepard@appl-ecosys.com>
Re: How useful is the money datatype? Sam Mason <sam@samason.me.uk>
Re: How useful is the money datatype? justin <justin@emproshunts.com>
Re: How useful is the money datatype? Guy Rouillier <guyr-ml1@burntmail.com>
Re: How useful is the money datatype? Christophe Pettus <xof@thebuild.com>
Re: How useful is the money datatype? Guy Rouillier <guyr-ml1@burntmail.com>
Re: How useful is the money datatype? Bruce Momjian <bruce@momjian.us>
Re: How useful is the money datatype? Guy Rouillier <guyr-ml1@burntmail.com>
Re: How useful is the money datatype? John R Pierce <pierce@hogranch.com>
Re: How useful is the money datatype? Christophe Pettus <xof@thebuild.com>
Re: How useful is the money datatype? Sam Mason <sam@samason.me.uk>
Re: How useful is the money datatype? Peter Geoghegan <peter.geoghegan86@gmail.com>
Re: How useful is the money datatype? Thom Brown <thombrown@gmail.com>
On Sun, 4 Oct 2009, Sam Mason wrote: >> Withing PG procedures at least in pgsql it is impossible to do 'money' >> calculations without a loss of precision. > > The point is that on *any* computer it's impossible to perform arbitrary > calculations to infinite precision (i.e. "without a loss of precision as > you put it). I've not followed this tread, but read this one message, so perhaps my comments are not appropriate. In that case, I apologize for jumping in. Monetary values have always been an issue with computers. For a while, at least in the mainframe world of decades ago, binary-coded decimals (BCD) were a working approach. In the early and mid-1980s we used a procedure for business applications involving money that worked regardless of programming language or platform. To each (float, real) monetary amount we added 0.005 and truncated the result to two digits on the right of the decimal point. In almost all cases, this allowed financial calculations to be correct to the nearest penny. Financial calculations are still imperfect. Now and then I see this in both my business and personal bank statements when reconciliation is off by a penny or two. The transaction amounts (debits and credits) match, but the bank comes out with a different total than do I. This is usually only for a month or two before we are once again in agreement. Rich
В списке pgsql-general по дате отправления