use strict; my $number = 83.9774726111 ; print sprintf("%.3f", $number); # produces 83.977