my $blah = sprintf("%.2f", 3.1415926535); print "$blah\n"; __END__ prints 3.14