Just a little bit stuck, trying to find the right function to use:
$number = "4.999";
echo number_format($number, 2); //5.00
We want it to display as 4.99 – what PHP function should we use which won’t round anything, just purely limit the numbers after the decimal point to two?
use
printf:(
%.2fprints float numbers with 2 decimal places)edit I’ve read your question wrong the first time. What you are asking for is rounding down the number to 2 decimal places, then display it: