Skip to main content

Module format

Module format 

Source
Expand description

Human-readable formatting.

Called from the renderer only. Nothing here is on the per-process scan path: docs/DESIGN.md §9.4 — a format! inside a scan is a bug.

Functions§

bytes_human
Format a byte count using binary IEC units, matching htop.1 MEMORY SIZES.
cpu_time_human
Format CPU ticks as a MM:SS.cc figure, as the TIME column shows.
duration_human
Format a duration as MM:SS or H:MM:SS / D-HH:MM:SS (htop’s TIME+ style).
duration_verbose
Format a duration with explicit units, for places with room to spell it out.
percent_human
Format a percentage with one decimal, as a fixed-width cell.