What I want is to know how star ratings works. I don't get the logic of it.
Example:
5 star - 300 people
4 star - 45 people
3 star - 100 people
2 star - 99 people
1 star - 10 people
Total of 554 people
I want to convert these number of votes to percentage and compute all of it to get its average
5 star - 40% (300 people)
4 star - 10% (45 people)
3 star - 21% (100 people)
2 star - 20 % (99 people)
1 star - 9% (10 people)
a total of 100%
It's just a random percentage. It's not the correct answer.
How can I achieve that ? I don't think if that's the correct process of ratings.
First of all get total no of people vote.
and use this function to show percentage.
for example if you want to get 5 star rate percentage then
5 star percentage = 300 * 100 / 554