calculating average ratings from a series of review fields I've setup a section for reviews with several fields as numbers for a rating 0-5, I'm trying to figure out how to get the total of all reviews and sum of all reviews to provide a single average for an entry the reviews relate to.

What's the best approach to this.

Example of my fields:

Value
Condition
Reception
etc

all graded 0-5 (number fields).

So how to go through the foreach and get the sum of all fields from all reviews then divide by total reviews for the related entry to get the average for each field.
Something like this should work:

{% set reviews = craft.entries.section('reviews').relatedto(entry) %}
{% set value = 0 %}
{% set condition = 0 %}
{% set reception = 0 %}
{% set count = 0 %}
{% for review in reviews %}
    {% set value = value + review.value %}
    {% set condition = condition + review.condition %}
    {% set reception = reception + review.reception %}
    {% set count = loop.index %}
{% endfor %}
{% set averageValue = (value / count)|round(1, 'floor') %}
{% set averageCondition = (condition / count)|round(1, 'floor') %}
{% set averageReception = (reception / count)|round(1, 'floor') %}