22.03.2010, 17:11
pawn Код:
new valueA;
valueA=7;
new Float:floatA=valueA;
floatA/=10.0; // Results as 0.699999 instead of 0.700000
printf("%.1f",floatA);
Why sometimes floats don't divide correctly is beyond me, but my question is:
How would I round that 0.699999 to 0.700000 so I'll be able to display it as 0.7 instead of 0.6?
I've searched the forum thus how I came across learning to only display 0.7 instead of 0.700000, but nothing about rounding that .1 to make it 0.7
The Wiki explains only the basics of rounding up floats (Whole Numbers), but nothing about what I'm asking for... Unless I missed something
So if you know of a post/page that would explain how this is all done, I would appreicate a link, thanx for reading
