Count size in signed 64-bit integers

This commit is contained in:
2025-12-17 13:43:23 +02:00
parent f98760d1dd
commit 2a7c6ce5d9
5 changed files with 24 additions and 32 deletions
-11
View File
@@ -119,17 +119,6 @@ func stringSliceRemove(s []string, r string) []string {
return s
}
func unsignedBytesToHumanReadable(b uint64) string {
bf := float64(b)
for _, unit := range []string{"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"} {
if math.Abs(bf) < 1024.0 {
return fmt.Sprintf("%3.1f%sB", bf, unit)
}
bf /= 1024.0
}
return fmt.Sprintf("%.1fYiB", bf)
}
func bytesToHumanReadable(b int64) string {
bf := float64(b)
for _, unit := range []string{"", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"} {