polaris.run.memory.format_bytes

polaris.run.memory.format_bytes(nbytes: int | None) → str[source]

Format a number of bytes for a log, in binary units.

Parameters:

nbytes (int or None) – The number of bytes, or None if it is not known

Returns:

text (str) – The number with the largest unit that leaves it at least 1