diff --git a/internal/percentage.go b/internal/percentage.go index a8ef8be..4bc36f5 100644 --- a/internal/percentage.go +++ b/internal/percentage.go @@ -3,7 +3,7 @@ import "math" // Percentage is a helper function, to calculate percentage. -func Percentage(total, current int64, width int) float64 { +func Percentage(total, current int64, width uint) float64 { if total <= 0 { return 0 } @@ -14,6 +14,6 @@ } // PercentageRound same as Percentage but with math.Round. -func PercentageRound(total, current int64, width int) float64 { +func PercentageRound(total, current int64, width uint) float64 { return math.Round(Percentage(total, current, width)) } diff --git a/internal/percentage_test.go b/internal/percentage_test.go index 6d5410d..515ad60 100644 --- a/internal/percentage_test.go +++ b/internal/percentage_test.go @@ -4,7 +4,7 @@ func TestPercentage(t *testing.T) { // key is barWidth - testSuite := map[int][]struct { + testSuite := map[uint][]struct { name string total int64 current int64