
mhx
Enthusiast
/ Moderator
Jul 3, 2001, 2:21 PM
Post #2 of 2
(554 views)
|
Hi, you can use the printf function, for example:
my $number = 11; my $total = ($number * 0.25); printf "%.0f", $total; This will actually round $total. If you rather want to truncate $total, you can use either
my $number = 11; my $total = ($number * 0.25); printf "%d", $total; or
my $number = 11; my $total = int($number * 0.25); print $total; Hope this helps. -- Marcus
|