I am looking at the money_format function in php and confused on how to get it to format the way I want. I do not want USD in front of my string, I want a comma every 3 digits and 2 decimal points so 12345.67 will be formated to $12,345.67
Thanks.
The money_format() function is an inbuilt function in PHP that returns a number formatted as a currency string.
United States (U.S.) currency is formatted with a decimal point (.) as a separator between the dollars and cents. Some countries use a comma (,) instead of a decimal to indicate that separation.
Have you looked at number_format
? It's a little easier I think.
print number_format( 1234567, 2, ",", "." );
for example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With