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


Well-known member
XenResource_ControllerPublic_Author::actionView()'s $viewParams array contains this line:
    'ratingAvg' => $resourceModel->getRatingAverage(
        $aggregate['rating_sum'], $aggregate['rating_count']
XenResource_Model_Resource::prepareResource() should contains this line:
$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
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 :)