NUmber rounding
Posted by Jeff Gray on Sep 23, 2011; 6:17am
URL: https://forum.world.st/NUmber-rounding-tp3835875.html
I am reading a list of numbers from a csv file. The file represents financial transactions so all the numbers are currency and they have zero, one or 2 decimal places
Eg 1000 240.46 100.5
I use Number readFrom: to get from text to number.
When I add all the amounts the answer comes out like: 306.65999999999985
I want to see 306.66
I had alook at Stef's chapter talking aboy 2s compliment and I'm guessing that this is something like that but I read most of it as: meow meow meow moew. Too hard :-) Can someone just tell me which class/method I need?
Thanks.
I know this might come across as lazy but my background is as an application developer and I'm just not that interested in the low level system guts. And I'm slightly lazy.....