From 95b9acd3244577c4a021a3b91579241fabc0c969 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sun, 19 Nov 2023 11:00:43 -0500 Subject: [PATCH] improve pull percentage rendering --- progress/bar.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/progress/bar.go b/progress/bar.go index 5ebc203d..6be4ab2b 100644 --- a/progress/bar.go +++ b/progress/bar.go @@ -2,6 +2,7 @@ package progress import ( "fmt" + "math" "os" "strings" "time" @@ -55,7 +56,7 @@ func (b *Bar) String() string { pre.WriteString(" ") } - fmt.Fprintf(&pre, "%.0f%% ", b.percent()) + fmt.Fprintf(&pre, "%3.0f%% ", math.Floor(b.percent())) fmt.Fprintf(&suf, "(%s/%s, %s/s, %s)", format.HumanBytes(b.currentValue),