use printf() or sprintf()
perldoc -f sprintf will give you all the details on it but here's kind of how it would be used:
$number should now be '29', the first argument to sprintf (and to printf) is the format string. '%' is where you are going to insert the value, the .0f means, floating point with no decemal places.my $number = 29.2; $number = sprintf("%.0f",$number);
Chris
Lobster Aliens Are attacking the world!In reply to Re: easy math?
by cfreak
in thread easy math?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |