Reputation: 4756
Just had a really simple question.
I'm making a review system and I want the scores to be rounded off to the nearest multiple of 0.5
So what I mean is:
0 / 0.5 / 1 / 1.5 / 2 / 2.5 /....
What's the best way of doing this?
I currently have this code but this isn't working
$score = ($food + $staff + $value + $atmosphere) / 4;
$score = ceil($score * 2) / 2;
Upvotes: 1
Views: 3507