use strict; use warnings; use Math::Round; my $rnd=Math::Round::Var->new (0.001); my $frsmt = $mtbf_data[3]; # use "$" instead of "@" if you only extract one value of that row $frsmt =~ tr[.][]d; # eliminate all dots from the number $frsmt =~ tr[,][.]d; # turn all commas into dots $rounded_percent_frsmt=$rnd->round($frsmt); print "$rounded_precent_frsmt\n";