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


in reply to int($x) gives strange result

If you just want to cut off decimal places you can use the sprintf function:
$x = sprintf('%.2f', $x);