Raxol. Utils. Format
(Raxol v2.6.0)
View Source
Shared formatting utilities for human-readable output.
Summary
Functions
Formats a byte count as a human-readable string using SI units (1000-based).
Formats a byte count using binary units (1024-based, IEC).
Functions
Formats a byte count as a human-readable string using SI units (1000-based).
Examples
iex> Raxol.Utils.Format.format_bytes(1_500_000)
"1.5 MB"
iex> Raxol.Utils.Format.format_bytes(512)
"512 B"
Formats a byte count using binary units (1024-based, IEC).
Examples
iex> Raxol.Utils.Format.format_bytes_iec(1_048_576)
"1.0 MB"
iex> Raxol.Utils.Format.format_bytes_iec(512)
"512 B"