[plt-scheme] Currency and rounding?

From: Sam TH (samth at ccs.neu.edu)
Date: Tue Aug 26 16:10:57 EDT 2008

On Tue, Aug 26, 2008 at 4:06 PM, Grant Rettke <grettke at acm.org> wrote:
> Hi folks,
>
> How do you normally handle working with currency and rounding inexact numbers?

For currency, you should *never* use inexact numbers.   The are a few
possibilities here:

- Store everything in cents
- Use Scheme's exact rationals
- Implement your own exact base-10 numbers

And probably more that I haven't thought of.

Thanks,
-- 
sam th
samth at ccs.neu.edu


Posted on the users mailing list.