Hmmm... I saw many answers here. But what about the usual way of rounding?
$rounded=int($value+0.5); Later... What I've learned:
1) Just because you always did something in a specific way doesn't mean it's correct.
2) Just becaus a text seems complicated doesn't mean you are free to ignore it
3) Sometimes you learn it the hard way ;-/