$i = sprintf "%.0f", 254.99; print "$i\n"; # printf/sprintf rounds rather than truncates using %f # however %d works just like int() printf "Number %.3f int %d sprintf %.0f\n",$_/7,$_/7,$_/7 for 1..100;