MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / formatBytes

Function formatBytes

cli/release/index.js:295–301  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

293}
294
295function formatBytes(bytes) {
296 if (bytes === 0) return '0 B'
297 const k = 1024
298 const sizes = ['B', 'KB', 'MB', 'GB']
299 const i = Math.floor(Math.log(bytes) / Math.log(k))
300 return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]
301}
302
303function createProgressBar(percentage, width = 30) {
304 const filled = Math.round((width * percentage) / 100)

Callers 2

downloadBinaryFunction · 0.70
getInstalledBinaryStatusFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected