my $foo = "12314212412124124124.10623"; my $text = sprintf("%.2f", $foo); print $text;