in reply to Rounding without int() or printf()
# $rounded = round($value, $places); sub round { my ($N,$P) = @_; my $pm = $N > 0 ? 1 : -1; return int($N * 10**$P + .5 * $pm) / 10**$P; } [download]