Codebase list golang-github-vbauerster-mpb / adfc7e7
Better edge case check Vladimir Bauer 9 years ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
513513 }
514514
515515 func percentage(total, current int64, ratio int) int {
516 if current > total || (total == 0 && current == 0) {
516 if total == 0 || current > total {
517517 return 0
518518 }
519519 num := float64(ratio) * float64(current) / float64(total)