Skip to content

Commit

Permalink
humanizeBytes: use the old base and sizes variables declaration order
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev committed Oct 12, 2023
1 parent 9641659 commit 5f5f2f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions progressbar.go
Expand Up @@ -1079,12 +1079,12 @@ func average(xs []float64) float64 {
}

func humanizeBytes(s float64, iec bool) (string, string) {
base := 1000.0
sizes := []string{" B", " kB", " MB", " GB", " TB", " PB", " EB"}
base := 1000.0

if iec {
base = 1024.0
sizes = []string{" B", " KiB", " MiB", " GiB", " TiB", " PiB", " EiB"}
base = 1024.0
}

if s < 10 {
Expand Down

0 comments on commit 5f5f2f9

Please sign in to comment.