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

Function formatBytes

cli/release-staging/index.js:296–302  ·  view source on GitHub ↗
(bytes)

Source from the content-addressed store, hash-verified

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

Callers 1

downloadBinaryFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected