Rounding up a number to the nearest 0.5? (Ratings)
Hi,
I'm trying to implement a rating system with half ratings, and I'm struggling with how to calculate the rounded up rating figure. It keeps round itself up to whole numbers, but I want it to round itself up to halves too?
At the moment, I've been using number_format() and round(), but it won't, for example, round 3.46 up to 3.5...
Please may someone help me?
Thank you.
Edit: Thank you! I'm using this solution.
I'm trying to implement a rating system with half ratings, and I'm struggling with how to calculate the rounded up rating figure. It keeps round itself up to whole numbers, but I want it to round itself up to halves too?
At the moment, I've been using number_format() and round(), but it won't, for example, round 3.46 up to 3.5...
Please may someone help me?
Thank you.
Edit: Thank you! I'm using this solution.

