Closed minibits-cash closed 4 months ago
hey thanks for the issue! There are two issues I see here. One is that the I was sorting the items on each page rather than sorting against all items. I just fixed that here.
The other problem is the weighted average was not being calculated correctly. I don't think your solution is correct either though because const aRating = (a.totalRatings / a.reviewsWithRating) * a.reviewsWithRating;
reduces to just totalRatings
.
reviewsWithRatings
is the number of reviews on each mint where number of ratings is defined and totalRatings
is the sum of all the stars on that mint.
Ah I see I've messed it. Thank you for your time to fix it.
Hi, thank you for the great project. I've briefly look at the code redering the mints table and I think that there is a small glitch when sorting the results (I assume that the goal is to sort the mints by rating weighted by number of reviews).
Current code:
seems to always reduce a.reviewsWithRating / a.reviewsWithRating to 1 so that the whole formula becomes a.totalRatings / 5. I'd suggest to fix it to something similar to (untested):