<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/e0d80c67993d25b72681b783bd13813a"
  from="Joshua Smith &lt;kognate@g...&gt;"
  author="Joshua Smith"
  date="2006-02-19T13:43:38"
  subject="What library to use for arbitrary precision decimals"
  prev="2006/02/26e0e034e81973bfaabae58148b29f96"
  next="2006/02/dfa9c0a2577effa6597ec330bf48dce3"
  next-in-thread="2006/02/6a4ece1ab3283a32cdfc79d59c82478d"
  prev-thread="2006/02/26e0e034e81973bfaabae58148b29f96"
  next-thread="2006/02/7ced1cf6716695b05c93739612f75c5d"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/e0d80c67993d25b72681b783bd13813a"
  from="Joshua Smith &lt;kognate@g...&gt;"
  author="Joshua Smith"
  date="2006-02-19T13:43:38"
  subject="What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/6a4ece1ab3283a32cdfc79d59c82478d"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-19T15:44:16"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/34c5b33a2ce71032c5bfbac81e30432f"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-19T16:38:42"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/72ee455a5f011374a71925238a2ed762"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-19T16:53:25"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/92ca6367f5929b8a8d393bd551a0f41c"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-19T17:01:16"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/ea5f7ca7239b2b1d32ef4a745dbed037"
  from="Richard Jones &lt;rich@a...&gt;"
  author="Richard Jones"
  date="2006-02-19T17:13:26"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2006/02/024932e2e2c8b5b06b83662881c27c24"
  from="Jeremy Shute &lt;shutej@g...&gt;"
  author="Jeremy Shute"
  date="2006-02-19T17:21:44"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
<msg 
  url="2006/02/463692f8dc009e6672589f4cbd97f837"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2006-02-19T18:31:14"
  subject="Re: [Caml-list] What library to use for arbitrary precision decimals">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
There are a couple of ways to handle money transactions without
rounding errors.

You could use the Nums library, which provides arbitrary precision
calculations and numbers.   But even with arbitrary precision numbers,
you still can have the situation where you get 405.0345 which if this
were USD, you would still have to round if you wanted to pay someone
this amount.  You will still have the arbitrary precision this way,
however.

The best way to handle money (in my experience) is to use integers. 
Then you can define conversion functions but only have to convert it
to decimal for display purposes.  That way, even if you do a million
transactions you won't lose any information.   You can also handle
non-decimal based currencies/instruments/transactions that way[1]

HTH

-jbs

[1] yes,  there are a (thank god shrinking number) of commodities and
stuff like that in the world that don't use decimal prices.

</contents>

</message>

