[Haskell-cafe] Re: money type ?
rl at cse.unsw.edu.au
Thu Jul 12 06:39:57 EDT 2007
Donald Bruce Stewart wrote:
> Roman Leschinskiy tells me that there are C (or C++?) libraries for
> locale-specific money handling, where given precisions are mandated in
> particular countries, below which you must round. Perhaps we should have
> a binding to this.
IIRC, the rules in the EU were that operations on money have to be done
with 3 decimal digits and then rounded to 2. That is, 0.01 / 2 = 0.01
(0.005 rounded to 2 decimal digits). I may be mistaken, though. What I'm
fairly sure of is that required precision and rounding policies differ
from country to country. Getting it right is *much* harder than it looks.
More information about the Haskell-Cafe