MCPcopy Index your code
hub / github.com/kopia/kopia / BytesStringBase2

Function BytesStringBase2

internal/units/units.go:54–57  ·  view source on GitHub ↗

BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...)

(b T)

Source from the content-addressed store, hash-verified

52
53// BytesStringBase2 formats the given value as bytes with the appropriate base-2 suffix (KiB, MiB, GiB, ...)
54func 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.
60func BytesString[T realNumber](b T) string {

Callers 3

readInputFileMethod · 0.92
TestBytesStringBase2Function · 0.85
BytesStringFunction · 0.85

Calls 1

toDecimalUnitStringFunction · 0.85

Tested by 1

TestBytesStringBase2Function · 0.68