Answer the question
In order to leave comments, you need to log in
Do number_format and round have the same effect?
Hello, tell me please.
It doesn't matter if you use this notation:
Or this:
The result of these two functions is still the same . I just need to round the prices of goods, and I'm wondering if there will be a difference if I replace it with ?
Thank you in advance for your response
echo number_format(320.86, 0, '.', ' ');
echo round(320.86);
321
number_format
round
Answer the question
In order to leave comments, you need to log in
If you just need to round, then there is no need to use number_format, since it returns a String type. Use round
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question