<div dir="ltr">From memory: <div>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.<br>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).<br><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Apr 4, 2017 at 5:16 PM Saurabh Nanda <<a href="mailto:saurabhnanda@gmail.com">saurabhnanda@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Curious to know what StanChart is using to represent monetary values in its Haskell code.<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">-- Saurabh.</div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Tue, Apr 4, 2017 at 8:20 PM, Joachim Durchholz <span dir="ltr" class="gmail_msg"><<a href="mailto:jo@durchholz.org" class="gmail_msg" target="_blank">jo@durchholz.org</a>></span> wrote:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="gmail_msg">Am 04.04.2017 um 16:13 schrieb ALeX Kazik:<br class="gmail_msg">
<blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Leaving aside the legal aspects of this, what would be Haskell's equivalent<br class="gmail_msg">
of the BigDecimal format in Java (or Ruby)? Decimal (as used by hledger)?<br class="gmail_msg">
</blockquote>
<br class="gmail_msg">
Rational?<br class="gmail_msg">
</blockquote>
<br class="gmail_msg"></span>
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.<div class="m_2803523843561220875HOEnZb gmail_msg"><div class="m_2803523843561220875h5 gmail_msg"><br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
Haskell-Cafe mailing list<br class="gmail_msg">
To (un)subscribe, modify options or view archives go to:<br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="gmail_msg">
Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br class="gmail_msg"><br clear="all" class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg">-- <br class="gmail_msg"><div class="m_2803523843561220875gmail_signature gmail_msg" data-smartmail="gmail_signature"><a href="http://www.saurabhnanda.com" class="gmail_msg" target="_blank">http://www.saurabhnanda.com</a></div>
</div>
_______________________________________________<br class="gmail_msg">
Haskell-Cafe mailing list<br class="gmail_msg">
To (un)subscribe, modify options or view archives go to:<br class="gmail_msg">
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" class="gmail_msg" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="gmail_msg">
Only members subscribed via the mailman list are allowed to post.</blockquote></div></div></div><div dir="ltr">-- <br></div><div data-smartmail="gmail_signature"><div dir="ltr"><div><font color="#000000">Frederic Cogny<br></font></div><font color="#000000"><font>+33 </font><span>7 83 12 61 69</span></font><br></div></div>