Raxol.Utils.MemoryFormatter (Raxol v2.0.1)
View SourceUtility 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(1048576)
"1.00 MB"
iex> Raxol.Utils.MemoryFormatter.format_memory(1073741824)
"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"