This is a mathematical rule of rounding of numbers: if digit before last visible digit is greater than 5 last digit is increased by 1, otherwise the digit saves its value.
So, 0.256 ~ 0.26, 0.255 ~ 0.25, 0.254 ~ 0.25. This is correct results.
---
Michael Stepanov aka nite_man
It's only my opinion and it doesn't have pretensions of absoluteness!
In reply to Re: Rounding a number using (s)printf
by nite_man
in thread Rounding a number using (s)printf
by the_slycer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |