Update On Wed Jul 3 20:29:14 CEST 2024

This commit is contained in:
github-action[bot]
2024-07-03 20:29:14 +02:00
parent 55a38739d4
commit 4375830eb7
243 changed files with 2278 additions and 3689 deletions

View File

@@ -14,3 +14,13 @@ func PrettyByteSize(bf float64) string {
}
return fmt.Sprintf(" %.1fYiB ", bf)
}
func PrettyBitRate(bps float64) string {
for _, unit := range []string{"bps", "Kbps", "Mbps", "Gbps", "Tbps", "Pbps", "Ebps", "Zbps"} {
if math.Abs(bps) < 1000.0 {
return fmt.Sprintf(" %3.1f %s ", bps, unit)
}
bps /= 1000.0
}
return fmt.Sprintf(" %.1f Ybps ", bps)
}