BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...)
(b T)
| 52 | |
| 53 | // BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...) |
| 54 | func BytesStringBase2[T realNumber](b T) string { |
| 55 | //nolint:mnd |
| 56 | return toDecimalUnitString(b, 1024.0, base2UnitPrefixes, "B") |
| 57 | } |
| 58 | |
| 59 | // BytesString formats the given value as bytes with the unit provided from the environment. |
| 60 | func BytesString[T realNumber](b T) string { |