in reply to decimal calculation

I see you already have some nice answers to your question.

It appears that you are working with monetary units. This is something I work with often. The answer is nearly ALWAYS to work in 'cents' so that you can keep everything in an integer format and then just modify your presentation layer to add the decimal place where you want it. I'm sure that the FAQ linked will say something similar.

--
“For the Present is the point at which time touches eternity.” - CS Lewis