From 9731503826edab77b388ea03220fda66261e02ea Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 10 Dec 2021 15:43:42 +0100 Subject: [PATCH] Fix https://github.com/firefly-iii/firefly-iii/issues/5352 --- .../src/components/dashboard/BudgetLimitRow.vue | 2 -- .../src/components/dashboard/MainBudgetList.vue | 15 ++++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/dashboard/BudgetLimitRow.vue b/frontend/src/components/dashboard/BudgetLimitRow.vue index 2762557363..d26762a4ef 100644 --- a/frontend/src/components/dashboard/BudgetLimitRow.vue +++ b/frontend/src/components/dashboard/BudgetLimitRow.vue @@ -31,8 +31,6 @@ {{ $t('firefly.spent_x_of_y', {amount: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.spent), total: Intl.NumberFormat(locale, {style: 'currency', currency: budgetLimit.currency_code}).format(budgetLimit.amount)}) }} - -
amount) { - pctOrange = (spentFloatPos / amount) * 100; + //console.log('Spent ' + name + ' OVER budget'); + pctOrange = (amount / spentFloatPos) * 100; pctRed = 100 - pctOrange; + //console.log('orange is ' + pctOrange); + //console.log('red is ' + pctRed); } // spent exactly on budget if (0.0 !== spentFloatPos && spentFloatPos === amount) { - pctOrange = 0; - pctRed = 100; + pctOrange = 100; + pctRed = 0; } let obj = {