From 4c80d929caf11e5f62c08c7aa12568d87e4cab19 Mon Sep 17 00:00:00 2001 From: James Cole Date: Wed, 1 May 2024 06:29:28 +0200 Subject: [PATCH] Possible division by zero? --- resources/views/budgets/index.twig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twig index 961aa85ce0..c7f9e36031 100644 --- a/resources/views/budgets/index.twig +++ b/resources/views/budgets/index.twig @@ -301,7 +301,11 @@ {% 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 %}
{% endfor %} {% for budgetLimit in budget.budgeted %}