The guy asked to round a number, the simplest way
is (my highschool teacher would be proud now..):
$rounded = int ( $orig + 0.5 )
This approach floors any decimal portion less than 0.5, and rounds up (in value) any decimal portion greater than .5. That means the following:
1.1 rounds to 1.0.
1.5 rounds to 2.0.
-1.1 rounds to 1.0.
-1.5 rounds to 1.0.