use Math::Round qw/ nearest /; my $rounded = nearest(1, $num * (10 ** $stellen)) / (10 ** $stellen);