[Haskell-cafe] What is a safe Haskell data type to store and manipulate Money values?
saurabhnanda at gmail.com
Tue Apr 4 14:00:35 UTC 2017
> 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.
That's an important point you raise.
Leaving aside the legal aspects of this, what would be Haskell's equivalent
of the BigDecimal format in Java (or Ruby)? Decimal (as used by hledger)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe