in reply to Sum to Zero?

A few people mentioned using sprintf or multiplication and division to force the rounding, both of which approximate the easiest answer.

Store your currency values in cents (or pence, or pfennig, or whatver your smallest currency unit is) and only convert them to dollars (or euros, or dm (oops, no more dm), or whatever) when its time to display them.

That will avoid most rounding issues.

You should still use floating point for storage, though, since you need to decide what you're going to do about fractions of cents resulting from interest, taxes, and such, but now you have to make a concious decision about that, which is good; before, your were ignoring the problem with rounding...

If you just keep the fractions of cents and then round to the nearest cent using some bankers rounding option or other when it's time to pay out or display money, you'll get results compatible with what you got when you were computing in dollars.
--
Mike