diff --git a/app_budget.html b/app_budget.html index e695762..68cacb2 100644 --- a/app_budget.html +++ b/app_budget.html @@ -77,7 +77,7 @@ function render(){ const sumB=rows.reduce((a,r)=>a+(+r.edit||0),0),spent=rows.reduce((a,r)=>a+r.spent,0); const ready=S.ready+(S.budgeted_month-sumB); $("#inc").textContent=money(S.income_month);$("#il").textContent=`Income · ${mname(month)}`; - $("#bud").textContent=money(sumB);$("#buds").textContent=S.income_month?`${Math.round(sumB/S.income_month*100)}% of this month’s income`:""; + $("#bud").textContent=money(sumB);$("#buds").textContent=S.income_month>=1?`${Math.round(sumB/S.income_month*100)}% of this month’s income`:""; $("#spent").textContent=money(spent); $("#ready").textContent=money(ready);const rb=$("#readybox");const z=Math.abs(ready)<0.005; rb.className="card kpi ready "+(z?"zero":ready<0?"neg":"pos");