I am creating a bitcoin based ad platform for a bitcoin learning portal. The reason I mention it is, I believe, it'll help to understand my problem and thereby I may get a better solution. What am I doing is simply passing the amount an user will pay from an HTML form to a PHP page and checking whether it is a multiple of 10. The code snippet is as follows...
$orderAmount = $_POST['orderAmount'];
$adUnitPrice = 0.001;
if((($orderAmount/$adUnitPrice) % 10) == 0)
$standardPayment = true;
else
$standardPayment = false;
When I am passing $orderAmount as 0.6 or 0.8, I get the expected return of $standardPayment = true. But, when I am passing $orderAmount as 0.7, I get the unexpected return of $standardPayment = false !!! Can someone please tell me what is the problem and how to fix this ?
bcmath module can help you
in your code
or even
you can check on command line with
php -m
and look if has the module or write a file with the followand look if has enable the module bcmath