MCPcopy Create free account
hub / github.com/PromtEngineer/localGPT / formatFileSize

Function formatFileSize

src/components/ui/chat-input.tsx:129–135  ·  view source on GitHub ↗
(bytes: number)

Source from the content-addressed store, hash-verified

127 }
128
129 const formatFileSize = (bytes: number) => {
130 if (bytes === 0) return '0 Bytes'
131 const k = 1024
132 const sizes = ['Bytes', 'KB', 'MB', 'GB']
133 const i = Math.floor(Math.log(bytes) / Math.log(k))
134 return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]
135 }
136
137 return (
138 <div className={`border-t border-white/10 bg-black/60 backdrop-blur-sm p-4 ${className}`}>

Callers 1

ChatInputFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected