MCPcopy Create free account
hub / github.com/simstudioai/sim / formatFileSize

Function formatFileSize

apps/sim/app/(landing)/models/utils.ts:171–181  ·  view source on GitHub ↗
(bytes?: number | null)

Source from the content-addressed store, hash-verified

169}
170
171export function formatFileSize(bytes?: number | null): string {
172 if (bytes == null) {
173 return 'Unknown'
174 }
175
176 const gb = bytes / (1024 * 1024 * 1024)
177 if (gb >= 1) {
178 return `${trimTrailingZeros(gb.toFixed(1))}GB`
179 }
180 return `${Math.round(bytes / (1024 * 1024))}MB`
181}
182
183export function formatPrice(price?: number | null): string {
184 if (price === undefined || price === null) {

Callers

nothing calls this directly

Calls 1

trimTrailingZerosFunction · 0.85

Tested by

no test coverage detected