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 bytesas 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 ๐