MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / formatSize

Function formatSize

tools/budget.go:120–131  ·  view source on GitHub ↗
(sizeBytes int)

Source from the content-addressed store, hash-verified

118 }
119 budgetForThis := max(0, maxChars-(total-charLen(content)))
120 output[item.index]["content"] = truncateAggregateContent(content, budgetForThis, len(results))
121 total = totalResultContentChars(output)
122 }
123
124 return output
125}
126
127func formatSize(sizeBytes int) string {
128 if sizeBytes < 1024 {
129 return fmt.Sprintf("%d B", sizeBytes)
130 }
131 if sizeBytes < 1024*1024 {
132 return fmt.Sprintf("%.1f KB", float64(sizeBytes)/1024)
133 }
134 if sizeBytes < 1024*1024*1024 {

Callers 2

ClampToAbsoluteMaxFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected