Hello,
I'm developing a custom blog, and I need to calculate a rating for each blog entry.
I'm stuck on what formula to use for the rating.
Let's say 10 people voted for a blog on a 5 star system...
3 people gave 5 stars
4 people gave 4 stars
1 person gave 3 stars
2 people gave 2 stars
0 gave 1 star
How do I calculate the effective stars for that blog?
I thought of mean value, i.e. taking the total number of stars, and dividing that by the aggregate number of voters.
35 = 15 stars
44 = 16 stars
13 = 3 stars
22 = 4 stars
Total # of stars = 38 stars
Total number of votes = 3+4+1+2 = 10
Average # of stars = 38/10 = 3.8
Is this the correct way to calculate this stuff?
Also, what do you recomment to use on the fraction:
floor()
round()
ceil()
TIA.