Possible division by zero?

This commit is contained in:
James Cole
2024-05-01 06:29:28 +02:00
parent 16364d9859
commit 4c80d929ca

View File

@@ -301,7 +301,11 @@
<td class="hidden-sm hidden-xs spent" data-id="{{ budget.id }}" style="text-align:right;">
{% for spentInfo in budget.spent %}
{{ formatAmountBySymbol(spentInfo.spent, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }}
({{ formatAmountBySymbol(spentInfo.spent / activeDaysPassed, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% if 0 == activeDaysPassed %}
({{ formatAmountBySymbol(spentInfo.spent, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% else %}
({{ formatAmountBySymbol(spentInfo.spent / activeDaysPassed, spentInfo.currency_symbol, spentInfo.currency_decimal_places) }})
{% endif %}
<br/>
{% endfor %}
{% for budgetLimit in budget.budgeted %}