I am retrieving rows with a money datatype from a database. These are
written to a file with 2 decimal places. I also keep a running total.
My problem is the total does not equal to the sum of details.

I have tried using 
$amount = sprintf('%.2f', $amount);
$total += $amount;

# do this after all tallying, just before writing to file
$total = sprintf('%.2f', $total);

How do I tally money with perl?


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to