• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Rating average has a ridiculous number of significant figures...

Jeremy

Well-known member
#4
XenResource_ControllerPublic_Author::actionView()'s $viewParams array contains this line:
PHP:
    'ratingAvg' => $resourceModel->getRatingAverage(
        $aggregate['rating_sum'], $aggregate['rating_count']
    ),
XenResource_Model_Resource::prepareResource() should contains this line:
PHP:
$resource['rating'] = $this->getRatingAverage($resource['rating_sum'], $resource['rating_count']);
Both do not enable rounding, which is the 3rd parameter to getRatingAverage() (defaults to false).
 

Chris D

XenForo developer
Staff member
#5
There was a third occurrence of the rating average not rounding, also, that I've fixed. Arguably we could have defaulted that method to round by default, but we'll avoid that in case anyone has extended or used that method in add-ons.

Fixed thanks :)