I can do this using printf()
printf ("Total amount of order is %.2f", $total);
Can I do the same using echo, or I have to use printf()?
I can do this using printf()
printf ("Total amount of order is %.2f", $total);
Can I do the same using echo, or I have to use printf()?
You can use this..
$total= 100.123;
echo "Total amount of order is ". round($total, 2);
Output:
Total amount of order is 100.12