$item = sprintf("%0.2f", $item);
print $item, "\n";

The above code prints -992.99 if $item = -993, while it prints 993.00, if
$item = 993.

Why is the rounded number off by 0.01 if the number is negative?

Thanks,
SU


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to