Browse Source

Fix budget reports when a category budget is zero

* elbank-budget.el (elbank-budget--insert-line): Handle zero budgets.
master
Nicolas Petton 2 years ago
parent
commit
28143b3076
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      elbank-budget.el

+ 3
- 1
elbank-budget.el View File

@@ -123,7 +123,9 @@ Return the report buffer."
(let* ((label (car budget-entry))
(spent (cadr budget-entry))
(budgeted (cl-caddr budget-entry))
(percentage (round (* 100 (/ spent budgeted)))))
(percentage (if (zerop budgeted)
100
(round (* 100 (/ spent budgeted))))))
(elbank-budget--insert-line-header label)
(elbank-insert-progressbar percentage 40)
(insert (format " %.2f of %.2f budgeted" spent budgeted))


Loading…
Cancel
Save