I create this rating system using 5x stars. And I want the title to include an average rating. So I created stars showing 1 / 5th. Using "1.2", I get a full star and one point on the next star and so on ...
But I did not find a good way to round to the nearest .2 ... I decided that I could multiply by 10, then round, and then start the switch in round 1 to 2, 3 to 4 and so on. But it seems tedious and unnecessary ...
math php rounding
peirix
source share