RE: [PHP] Dealing with dollars (& cents)
| From: | Jeroen Wesbeek | Date: | Wed, 01 Nov 2000 10:47:28 +0000 |
| Subject: | RE: [PHP] Dealing with dollars (& cents) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-23139@lists.php.net to get a copy of this message | ||
You should change your database field to support
these values (change the precision to a larger amount).
Grtz,
dowebwedo
Jeroen Wesbeek
.programming
St. Jacobsstraat 16
Postbus 448 | 3500 AK Utrecht
The Netherlands
p 030 2348110 | f 030 2348605
[roses are red, violets are blue,
I am schizophrenic and so am I ]
-----Original Message-----
From: CDitty [mailto:mail@redhotsweeps.com]
Sent: woensdag 1 november 2000 8:54
To: php-general@lists.php.net
Subject: [PHP] Dealing with dollars (& cents)
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
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net