|
-
Jul 9th, 2003, 10:36 AM
#1
Thread Starter
Hyperactive Member
Parsing dollar amounts from a string & totalling
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|