MyBB Community Forums

Full Version: How does the rating column formula work?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I have a question regarding how the rating column formula is determined for the star rating system.

Theoretically....if 100 users rate a thread with 5 stars, but one other person rates a thread with only 4 stars, how many stars would be displayed for the threads overall rating? Mathematically speaking, the overall numerical rating would be something like 4.990099....

Would the system automatically round up to 5 stars, or would it keep it at 4? If it does round up to 5 stars, what is the cutoff in terms of rounding (is it .75 or something like that?).

I appreciate any help on this subject.
Just in case anyone is interested, Mike was able to clear this up for me on the Audentio forum:

Mike Wrote:According to to ratethread.php, Kodaks, the code uses round(), which according to php.net does round up to the nearest ( as you would expect ). Example here http://us2.php.net/manual/en/function.round.php. Hope this helps somewhat, sorry I couldn't do more, Kodaks.


~Mike


http://www.audentio.com/forums/thread-27...ml#pid2243