Reputation: 1465
The number_format
function in PHP seems to round by default. My understanding is that this function is useful for separating every three numbers with a comma. Like 1403423 becomes 1,404,423 when using number_format.
So, if I have a large number that I want rounded to two decimal places, how can I do this and still have the commas properly displayed?
Desired behavior: 12042.529 --> 12,042.53
Upvotes: 0
Views: 2966