The numbers that are being pulled from an xml file and then assigned to a variable but are outputted incorrectly. I’m not quite sure why or how to get around it. An example is this.
$pricing_high = 1.15;
echo $pricing_high;
This displays 1.15 obviously. But when I assign this like so:
$price = ceil($pricing_high / 0.05) * 0.05;
echo $price;
This displays 2.
$price = round($pricing_high / 0.05) * 0.05;
echo $price;
This displays 1.
How do I get numbers to correctly round up to the nearest 5 cents when passing it like this?
As of PHP documentation for round function:
http://php.net/manual/en/function.round.php
You can specify precision as second parameter:
Note value of second parameter 2