Re: Re: Format of the Money field

From: "Mitch Vincent" <mitch(at)venux(dot)net>
To: "Dave Mertens" <dave(at)redbull(dot)zyprexia(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: Format of the Money field
Date: 2001-02-03 18:22:36
Message-ID: 00bc01c08e0e$48daf790$0200000a@windows
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I acknowledged the bad nature of the money field (pretty clearly stated in
my email, I think).. I agree, it shouldn't contain a sign of anything.. My
applications are used in the US and in the US only so I don't have issue
with the currency symbol. I don't use the money type anyway (the example I
used was from someone else's code!).. What I was actually asking about was
the need for the money type, the same thing can be achieved using the other
data types (in fact the documentation lists money as numeric(9,2) with the $
added I believe).. All that for exactly what you said, currency. There are
as many currencies as countries (almost) so I totally agree, a symbol is A
Bad Thing(TM).. You're also right (and bring up a good point) about the
storing of money in the smallest unit if you're coding international... I
haven't had to yet but it's something I'll be sure to do if it ever comes
up..

Of course all this is moot, Peter already said he was changing it and that
it shouldn't have been that way, it's just been overlooked (probably because
no one is using the money type)! :-)

I apologize to the list, I meant to send that email directly to Peter -- I
was too quick on the send..

-Mitch

----- Original Message -----
From: "Dave Mertens" <dave(at)redbull(dot)zyprexia(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Saturday, February 03, 2001 2:12 PM
Subject: Re: Re: Format of the Money field

> On Sat, Feb 03, 2001 at 11:39:29AM -0500, Mitch Vincent wrote:
> > What's the standard on Money type (if there is one) and if it doesn't
> > include the $ (of course that would change based on what currency you
were
> > using) then is it any different than numeric(9,2)? numeric(9,2) is what
I
> > use for all fields that need to hold a dollar amount so I'm curious.. I
> > remember reading in the documentation that money was numeric(9,2) with
the
> > dollar sign added but I wanted to check with the man :-)
>
> Oh, never heard of currency?? NOT every country is using dollars. In a few
> months we in Europe are going to use the Euro. A money-type is normaly a
> floating type with a precision of 5 (float(5)). A money field is just like
> an float, only less precies. By the way, storing money values with an
> decimal precision is a (mostly) a bad thing. We Save currency amounts in
> the smallest unit. We save every amount in Eurocents. Our programs format
> the amount to the proper format (US-format (35,673.56) or EuropeannFormat
> (35.673,56). Currency signs are bad things in databases. Most database are
> international, so most amounts also!
>
> Sorry for this hard correction.
>
> Dave Mertens
> System Administrator ISM, Netherlands
> dmertens(at)ism(dot)nl
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-03 18:47:56 Re: Like vs '=' bug with indexing
Previous Message Alex Pilosov 2001-02-03 17:36:01 Re: TODO list: Allow Java server-side programming