[Haskell-cafe] What is a safe Haskell data type to store and manipulate Money values?

Frederic Cogny frederic.cogny at gmail.com
Tue Apr 4 16:21:21 UTC 2017


>From memory:
At StanChart the Haskell library is mostly used in Financial Market for
derivatives pricing, the accounting and actual payment processing is done
by other back-office softwares.
So Double was used to represent "simulated" values (the price of a
derivative being the NPV of expected cash flows) and for computing actual
payments rounding rules are used with the relevant decimal (based on ISO
4217 tables).


On Tue, Apr 4, 2017 at 5:16 PM Saurabh Nanda <saurabhnanda at gmail.com> wrote:

> Curious to know what StanChart is using to represent monetary values in
> its Haskell code.
>
> -- Saurabh.
>
>
> On Tue, Apr 4, 2017 at 8:20 PM, Joachim Durchholz <jo at durchholz.org>
> wrote:
>
> Am 04.04.2017 um 16:13 schrieb ALeX Kazik:
>
> 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)?
>
>
> Rational?
>
>
> You'd be constantly be doing explicit calculations to get back to a
> denominator of 100. Plus you'd have to deal with those cases where the
> denominator is a divisor of 100, and you'd need explicit nonstandard
> conversion to strings.
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
>
>
>
>
> --
> http://www.saurabhnanda.com
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.

-- 
Frederic Cogny
+33 7 83 12 61 69
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170404/325fa65a/attachment.html>


More information about the Haskell-Cafe mailing list