Search code examples
androidratingratingbarrating-system

How to deal with Rating system (android + mysql)


I want to use a rate system in my app , well I know how to implement RatingBar but I need to know the way I can calculate rating after each rate For example user 1 give 5 starts but 2 other users gives 3 , 4 starts, so what is the result in this case and how to calculate it ? there is a formula of calculation for this issue ?


Solution

  • yes, you have to show the average rating

    the formula is (sum of all ratings)/(count of total rating)

    example 4 user give rating 1,2,3,5 respectively. then your formula be like
    (1+2+3+5)/4
    answer will be 2.75