in reply to Rounding function
sub round {
my ($number,$decimals) = @_;
return substr($number+("0." . "0" x $decimals . "5"),
0, $decimals+length(int($number))+1);
}
brother Willem
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Rounding function
by mythos (Sexton) on Oct 30, 2007 at 23:04 UTC | |
by dpestian (Initiate) on Jul 08, 2008 at 13:49 UTC |