mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 15:49:39 +02:00
Fix ZeroDivisionError (#557)
This commit is contained in:
parent
49d1fe0e11
commit
c7b336de45
1 changed files with 2 additions and 1 deletions
|
@ -40,7 +40,8 @@
|
|||
end
|
||||
|
||||
def percent_of_total
|
||||
return 100 if parent.nil?
|
||||
return 100 if parent.nil? || parent.sum.zero?
|
||||
|
||||
((sum / parent.sum) * 100).round(1)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue