MCPcopy
hub / github.com/kopia/kopia / formatCompressionPercentage

Function formatCompressionPercentage

cli/show_utils.go:99–109  ·  view source on GitHub ↗
(original, compressed int64)

Source from the content-addressed store, hash-verified

97}
98
99func formatCompressionPercentage(original, compressed int64) string {
100 if compressed >= original {
101 return "0%"
102 }
103
104 if original == 0 {
105 return "0%"
106 }
107
108 return fmt.Sprintf("%.1f%%", oneHundredPercent*(1-float64(compressed)/float64(original)))
109}
110
111func indentMultilineString(l, prefix string) string {
112 var lines []string

Callers 3

runMethod · 0.85
entryBitsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected