Codebase list golang-github-vbauerster-mpb / 67febec
sort example: percentage 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
3434 }
3535
3636 func percentage(total, current int64, ratio int) int {
37 if total <= 0 {
37 if total == 0 || current > total {
3838 return 0
3939 }
4040 return int(float64(ratio) * float64(current) / float64(total))