Bläddra i källkod

improve pull percentage rendering

Jeffrey Morgan 1 år sedan
förälder
incheckning
95b9acd324
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2 1
      progress/bar.go

+ 2 - 1
progress/bar.go

@@ -2,6 +2,7 @@ package progress
 
 
 import (
 import (
 	"fmt"
 	"fmt"
+	"math"
 	"os"
 	"os"
 	"strings"
 	"strings"
 	"time"
 	"time"
@@ -55,7 +56,7 @@ func (b *Bar) String() string {
 		pre.WriteString(" ")
 		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)",
 	fmt.Fprintf(&suf, "(%s/%s, %s/s, %s)",
 		format.HumanBytes(b.currentValue),
 		format.HumanBytes(b.currentValue),