in reply to strange arithmetic results

If you are dealing with currency, it is nearly always better to store the total cents, as opposed to the total dollars (and fractional cents), because floating point math and comparisons are not always consistent. It would also probably make your code much easier to follow, since you don't have to convert back and forth to do rounding.

If, however, you need to use the math this way, it's better to compare floating points using differences rather than straight operators particularly when values can approach each other.

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
It's not what you know, but knowing how to find it if you don't know that's important