I want to somehow round the numbers for a rating system in PHP like this:
4.6667 = 4.6
5.0001 = 5.0
Is there any way to do that? (BTW, I read the data from a database.)
You are not conforming to any single rule. For example:
4.6667 = 4.6
5.0001 = 5.1
See these functions anyway:
round
ceil
floor
And number_format.
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