I have a file that has dollar amounts in it in each line of the file.

I need to pull the amount out and total them. Amounts will always have 0, 1, or 2 decimals.

I used doubles, but I end up getting odd totals like this: 17362.899999999998

This occurs even when adding numbers like 569.91 and 419.03. I get 988.9399999999999.

How can I make sure I get the actual amount and not something funky?

Thanks!