Code
Hub
Trending
Following
Digest
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/simstudioai/sim
/ formatSize
Function
formatSize
apps/sim/lib/copilot/chat/workspace-context.ts:641–645 ·
view source on GitHub ↗
(bytes: number)
Source
from the content-addressed store, hash-verified
639
}
640
641
function
formatSize(bytes: number): string {
642
if
(bytes < 1024)
return
`${bytes}B`
643
if
(bytes < 1024 * 1024)
return
`${(bytes / 1024).toFixed(1)}KB`
644
return
`${(bytes / (1024 * 1024)).toFixed(1)}MB`
645
}
Callers
1
fileLine
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected