Dealing with dollars (& cents)
| From: | CDitty | Date: | Wed, 01 Nov 2000 07:53:48 +0000 |
| Subject: | Dealing with dollars (& cents) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23115@lists.php.net to get a copy of this message | ||
I am writing an affiliate program for one of my sites and am having problems figuring out the payments to the affiliates. I am storing all the configurable info in a mysql table. ie....site name, payout........
I am trying to figure out the total payout on the fly for each day. This is the formula that I am using. It is rather simple.
$payout[$mcount] = ($stats_result[0] * $result[3]);
$mcount is a small counter to count the days while looping. - this works ok. Starts at 1.
$stats_result[0] is a count of the total hits for any given day. - this works ok
$result[3] is the payout amount. - this works ok. I am using 5.50 for my testing.
When I echo each of the above values, they return the correct values. The problem is when I try and do the math. No matter what payout amount I put in the database, it will only return 5. It should return 5.50. Why? Is it the $payout[$mcount] ?
Did I explain this good enough? If not let me know and I will try and do better.
Thanks
CDitty