I am having trouble with something which I assumed should be rather easy but I cannot seem to find the answer anywhere. I have two numbers stored in variables which are supposed to represent dollar value and quantity pulled from an html form. When I try multiplying the amounts I get a whole number instead of a decimal number. For example:
When I run this code the output is "12" instead of "13.98". What am I doing wrong. Any help would surely be greatly appreciated.Code:$price = 6.99; $amount = 2; $totalPrice = $price * $amount; echo $totalPrice;
Best Regards,
David
Bookmarks