diff --git a/bandwidth.go b/bandwidth.go index 45505ee..18c1f44 100644 --- a/bandwidth.go +++ b/bandwidth.go @@ -114,7 +114,7 @@ func (b *BPS) Rate() float64 { // HumanRate returns a human-friendly (e.g. 23.3MB/s) rate. func (b *BPS) HumanRate() string { - return Bytes(uint64(b.Rate())) + "/s" + return human(uint64(b.Rate())) + "/s" } // Close cleans up and shuts down a BPS. diff --git a/bytes.go b/bytes.go index debee8a..41388fe 100644 --- a/bytes.go +++ b/bytes.go @@ -51,7 +51,7 @@ func humanateBytes(s uint64, base float64, sizes []string) string { // Bytes produces a human readable representation of an SI size. // // Bytes(82854982) -> 83MB -func Bytes(s uint64) string { +func human(s uint64) string { sizes := []string{"B", "kB", "MB", "GB", "TB", "PB", "EB"} return humanateBytes(s, 1000, sizes) }