Skip to main content

Module size

Module size 

Source
Expand description

format_bytes(n): a size in bytes the way people read it.

Constantsยง

STEP ๐Ÿ”’
Each unit is this many of the one before, as macOS and web browsers count, so a size reads the same on every system.
TENTHS ๐Ÿ”’
Tenths kept for sizes of a kilobyte or more.
UNITS ๐Ÿ”’

Functionsยง

format_bytes
bytes as text: "1 byte" and "999 bytes", then one decimal place in the largest unit that keeps the number at least 1, such as "1.5 MB".
rounded_tenths ๐Ÿ”’