Printing PHP float with 2 digits after the decimal point?
echo number_format($sum, 2); // 3.12
Try with:
$sum = 3.1234566768;
$rounded = round($sum, 2);
use number_format()
number_format($sum,2);
echo number_format($sum, 2); // 3.12
Try with:
$sum = 3.1234566768;
$rounded = round($sum, 2);
use number_format()
number_format($sum,2);