diff --git a/bar.go b/bar.go index 0c3e9e4..c1dfbb0 100644 --- a/bar.go +++ b/bar.go @@ -514,7 +514,7 @@ } func percentage(total, current int64, ratio int) int { - if current > total { + if current > total || (total == 0 && current == 0) { return 0 } num := float64(ratio) * float64(current) / float64(total)