Skip to main content

format_cpu

Function format_cpu 

Source
pub fn format_cpu(nanocores: i64) -> String
Expand description

Format a nanocore count as a human-readable CPU string.

Whole cores and exact millicores use the compact N/Nm forms; any other value renders its exact nanocore remainder as fractional cores (up to 9 decimals, trailing zeros trimmed), preserving sign, so a non-negative result round-trips through parse_cpu instead of collapsing to a truncated 0.000. parse_cpu rejects negative inputs.