# Not a bugRating calculation

#### Moshe1010

##### Well-known member
I wasn't sure where to post this, but this isn't quite accurate.
If you look at this add-on:
http://xenforo.com/community/resources/sonnb-xengallery-xenforo-gallery.2076/reviews

There are 33 reviews.
31 reviews = 5 starts
2 review s = 4 stars
Overall rating 4.5 stars.

If 5 stars represent 100%, then the average is:
31*5 = 155
2*4 = 8
155+8 = 163 then divide by 33 = 4.93. Thus, it should be 5 stars rating, and it shouldn't be 4.5 stars.

Even if we consider only 24 votes (because people voted twice):
22 reviews = 5 stars
2 reviews = 4 stars

22 * 5 = 110
2 * 4 = 8
======
118/24 = 4.916, still should be 5 stars.

Last edited:

#### Jeremy

##### Well-known member
I can only assume than if the average is between 4.5-4.99* that it'll be 4.5, 4.0-4.49* will be 4, etc., to make the lives easier for the calculations. However, Mike/Kier will have to comment.

#### Chris D

##### XenForo developer
Staff member
Hmm, I'm doubting myself now. There is a column that fetches the weighted average (which I believe is the bayesian average that Brogan linked to), but I do not think that's how the rating is calculated... I'm not sure.

There's a flaw in the original post, though. The average score isn't 4.5 at all. It's 4.92. That can be seen by the tooltip as you hover over the stars:

That means this is entirely correct:

Even if we consider only 24 votes (because people voted twice):
22 reviews = 5 stars
2 reviews = 4 stars

22 * 5 = 110
2 * 4 = 8
======
118/24 = 4.916, still should be 5 stars.

#### Moshe1010

##### Well-known member
Hmm, I'm doubting myself now. There is a column that fetches the weighted average (which I believe is the bayesian average that Brogan linked to), but I do not think that's how the rating is calculated... I'm not sure.

There's a flaw in the original post, though. The average score isn't 4.5 at all. It's 4.92. That can be seen by the tooltip as you hover over the stars:
View attachment 58119

That means this is entirely correct:
I was pointing out to the visual presentation of the rating itself. People don't go over the stars to get the tooltip, they look at the star rating, and therefore it's misleading.

#### Chris D

##### XenForo developer
Staff member
A full 5 stars would also be misleading as that's not what the real score is.

A suggestion for @Mike for RM 1.1 though, is perhaps it could have the Tooltip class added to it so it renders more instantly on mouse-over. Or maybe the score in brackets next to the vote count, e.g. 24 votes (4.92)

#### Moshe1010

##### Well-known member
A full 5 stars would also be misleading as that's not what the real score is.

A suggestion for @Mike for RM 1.1 though, is perhaps it could have the Tooltip class added to it so it renders more instantly on mouse-over. Or maybe the score in brackets next to the vote count, e.g. 24 votes (4.92)
Major selling websites work like that. For example, see Amazon for its rating system. A 4.92 would be considered 5 stars.

#### Mike

##### XenForo developer
Staff member
We basically round down. You can change the behavior in the "rating" template if you wish, but it's just a decision that has been made and isn't necessarily wrong.