See the Perl Cookbook "2.3. Rounding Floating-Point Numbers".
Use the Perl function sprintf, or printf if you're just trying to produce output:
$rounded = sprintf("%FORMATf", $unrounded);
Bye
PetaMem All Perl: MT, NLP, NLU
In reply to Re: Rounding a number?
by PetaMem
in thread Rounding a number?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |