The field value is : 5.5 But I want to show like : 5.50
I tried
number_format($_REQUEST['price'], 2, '.', '');
round($_REQUEST['price'],2);
but all showing 5.5
The field value is : 5.5 But I want to show like : 5.50
I tried
number_format($_REQUEST['price'], 2, '.', '');
round($_REQUEST['price'],2);
but all showing 5.5
That is because you are rounding the number after you format it.
You need to round it first (or during the format). This should work:
number_format(round($_REQUEST['price'], 2), 2, '.', '');