in reply to decimal places

Perl has printf(). And so you may use of advantage of the following:
printf "%.2f\n", $percent;
Updated: Currected mixed up decimal places with decimal digits.

-- Yuriy Syrota

Replies are listed 'Best First'.
Re: Re: decimal places
by osama (Scribe) on Jan 17, 2003 at 14:09 UTC
    you could use sprintf:
    my $percent = sprintf ("$.2f",100*$amount / $length);
    that way the variable $percent contains the rounded result