%expand%
# round to any decimal place
sub round {
my ($n,$d) = @_;
return int($n/(10**$d) + .5 * ($n <=> 0)) * (10**$d);
}
Labels: perl, programming
}))| Bracing against the wind | |
| www.documentroot.com |
|
Thursday, May 08, 2008
Perl Round Function
Labels: perl, programming [View/Post Comments] [Digg] [Del.icio.us] [Stumble] |
|
Bloghop:
|
Blogarama
|
Technorati
|
Blogwise