Sum up number fields in the loop
Hmm... hard to tell because I can’t know what your expected result would be. But if I had to guess then you might be looking for just this:

{% if aPrice %}
    {% set thisMonthEarning = thisMonthEarning + aPrice %}
{% endif %}