Re: Re: Format of the Money field

From: Dave Mertens <dave(at)redbull(dot)zyprexia(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: Format of the Money field
Date: 2001-02-03 19:12:37
Message-ID: 20010203191237.B7265@redbull.zyprexia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2001-02-03 20:04:21 Re: [HACKERS] ERROR: "Database 'products', OID nnn, has disappeared from pg_database"
Previous Message Tom Lane 2001-02-03 18:47:56 Re: Like vs '=' bug with indexing