Raxol. Utils. MemoryFormatter
(Raxol v2.6.0)
View Source
Utility functions for formatting memory values.
Summary
Functions
Format memory value in bytes to human-readable format.
Format memory difference with sign.
Functions
Format memory value in bytes to human-readable format.
Examples
iex> Raxol.Utils.MemoryFormatter.format_memory(1024)
"1.00 KB"
iex> Raxol.Utils.MemoryFormatter.format_memory(1_048_576)
"1.00 MB"
iex> Raxol.Utils.MemoryFormatter.format_memory(1_073_741_824)
"1.00 GB"
Format memory difference with sign.
Examples
iex> Raxol.Utils.MemoryFormatter.format_memory_diff(1024)
"+1.00 KB"
iex> Raxol.Utils.MemoryFormatter.format_memory_diff(-1024)
"-1.00 KB"