mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 06:44:52 +00:00
Fix ZeroDivisionError (#557)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user