in reply to Re^2: Multiplication problem
in thread Multiplication problem
You could take mwah's solution. Or, you could convert everything to integers. So, instead of working in dollars, you work in cents.
And that works when tested.my $price = 1795; # Cents, not dollars my $qtyx = 3; # Amount, not a price. my $cost = $price * $qtyx; my $cost_to_display = $cost / 100;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Multiplication problem
by John Vanbeek (Initiate) on Dec 10, 2007 at 16:28 UTC | |
by dragonchild (Archbishop) on Dec 11, 2007 at 20:56 UTC |