number_format( floatval ($string_variable), 2);
Recent Posts
How to solve: number_format() expects parameter 1 to be double, string given
This error is common when the function number_format recieves an empty string or a string with special characters. To solve this you can use floatval to make the conversion to float.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment