in reply to Rounding off numbers
use POSIX 'floor'; sub round { my $x = shift; floor($x + 0.5); }
You can use int instead of POSIX::floor if you don't need to round negative numbers. Anyway, read the docs for the int operator in perlfunc man page.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Rounding off numbers
by Tanalis (Curate) on Apr 20, 2006 at 14:36 UTC | |
by sgifford (Prior) on Apr 20, 2006 at 14:37 UTC |