diff options
Diffstat (limited to 'vendor/github.com/vbauerster/mpb/v5/internal')
-rw-r--r-- | vendor/github.com/vbauerster/mpb/v5/internal/percentage.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/vendor/github.com/vbauerster/mpb/v5/internal/percentage.go b/vendor/github.com/vbauerster/mpb/v5/internal/percentage.go index 7e261cb22..e321e0a6b 100644 --- a/vendor/github.com/vbauerster/mpb/v5/internal/percentage.go +++ b/vendor/github.com/vbauerster/mpb/v5/internal/percentage.go @@ -7,6 +7,9 @@ func Percentage(total, current int64, width int) float64 { if total <= 0 { return 0 } + if current >= total { + return float64(width) + } return float64(int64(width)*current) / float64(total) } |