G
Guest
Hi, I have the following code, where the multiplication results in a
dollar amount which needs to be rounded to the nearest cent.
$a = sprintf("%.2f", 1900*18.12895);
print $a;
The multiplication yields the value 34445.005, which should be rounded
up to 34445.01, but perl says that $a has the value 34445.00. Why is
it exhibiting this behavior?
dollar amount which needs to be rounded to the nearest cent.
$a = sprintf("%.2f", 1900*18.12895);
print $a;
The multiplication yields the value 34445.005, which should be rounded
up to 34445.01, but perl says that $a has the value 34445.00. Why is
it exhibiting this behavior?