MCPcopy Create free account
hub / github.com/FastLED/FastLED / format_size

Function format_size

ci/compiler/packages.py:582–589  ·  view source on GitHub ↗

Format size in a human-readable way

(size_mb: float)

Source from the content-addressed store, hash-verified

580
581
582def format_size(size_mb: float) -> str:
583 """Format size in a human-readable way"""
584 if size_mb < 1:
585 return f"{size_mb * 1024:.1f} KB"
586 elif size_mb < 1024:
587 return f"{size_mb:.1f} MB"
588 else:
589 return f"{size_mb / 1024:.1f} GB"
590
591
592# Display Functions with Enhanced Formatting

Callers 3

test_format_sizeMethod · 0.90
display_package_infoFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_format_sizeMethod · 0.72