Re: Money type todos? - Mailing list pgsql-hackers

From August Zajonc
Subject Re: Money type todos?
Date
Msg-id 46015294.1090608@augustz.com
Whole thread Raw
In response to Re: Money type todos?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Andrew Dunstan wrote:
> August Zajonc wrote:
>>  The only other nice thing would be user defined precision, but
>> can live without that as most currencies work under nnn.mm. 
> 
> That's useless for our system at least. The minimum scale we use for
> money values is 5. I guess we can just continue to use numeric though.
> 

Emailing off list with Andrew I'm reminded of one other feature that
would be potentially valuable in a money type, and that's being able to
specify the method of rounding.

There end up being a number of different rounding methods out there, and
in some cases it is very valuable to critical to follow a certain
method, usually dictated by externalities such as trading partners etc.

This could probably be a compile time flag even for postgresql and is
obviously a low priority behind speed.

Symmetric Arithmetic Rounding
Bankers Rounding
Round-half-down

Not sure its worth doing and if so probably a low priority, just
mentioning it for completeness.

- August





pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: [COMMITTERS] pgsql: Native shared memory implementation for win32.
Next
From: Shane Ambler
Date:
Subject: Re: Money type todos?