http://www.perlmonks.org?node_id=544615


in reply to Re^2: Rounding off numbers
in thread Rounding off numbers

Adding 0.5 before the int, as in the above example, solves that.