I want to format a double value returned from db to 2 decimal places
I tried number_format($amount,2) but it didn’t work
2
Try and explicitly cast the double value to float like mentioned in this thread here
Also, check what type is the $amount variable in your example..
Use the php number_format
number_format($number, 2, '.', ',');
Click here to cancel reply.
2
Answers
Try and explicitly cast the double value to float like mentioned in this thread here
Also, check what type is the $amount variable in your example..
Use the php number_format