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

Function formatBytes

freebuff/cli/release/index.js:292–298  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

290}
291
292function formatBytes(bytes) {
293 if (bytes === 0) return '0 B'
294 const k = 1024
295 const sizes = ['B', 'KB', 'MB', 'GB']
296 const i = Math.floor(Math.log(bytes) / Math.log(k))
297 return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i]
298}
299
300function createProgressBar(percentage, width = 30) {
301 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