Hallo!
sub Runden {
my $wert = $_[0];
my $helper = int($wert);if (($wert-$helper) >= 0.5) {
$helper++;
}
return $helper;
}
Dasselbe in kurz: $rounded = int($wert + 0.5);
Bin mir jetzt aber nicht sicher, ob das mit negativen Zahlen auch hinhaut.
Zum Runden auf x Stellen: <http://www.activestate.com/ActivePerl/docs/lib/Pod/perlfaq4.html#does perl have a round() function what about ceil() and floor() trig functions>
So lange