[Haskell-cafe] What is a safe Haskell data type to store and manipulate Money values?
Sven Panne
svenpanne at gmail.com
Tue Apr 4 13:46:55 UTC 2017
2017-04-04 7:05 GMT+02:00 Manuel Gómez <targen at gmail.com>:
> [...] Check whether regulatory compliance affects your choice of
> semantics.
>
This is the most important advice: You'll probably run into legal trouble
if you choose e.g. the wrong rounding mode, and for a good reason: If you
handle millions of transactions in your system and sneakily always round
cents "into your own pocket", you'll be a rich man. That's the reason
behind the tons of rounding modes in e.g.
http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html. Ask
your local lawyer which is the right one. ;-) I have serious doubts that
you can handle such things with a floating point representation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170404/6d626d20/attachment.html>
More information about the Haskell-Cafe
mailing list