MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / fmtCpu

Function fmtCpu

frontend/app/view/processviewer/processviewer.tsx:54–63  ·  view source on GitHub ↗
(cpu: number)

Source from the content-addressed store, hash-verified

52}
53
54function fmtCpu(cpu: number): string {
55 if (cpu == null) return "";
56 if (cpu === -1) return " -";
57 if (cpu === 0) return " 0.0%";
58 if (cpu < 0.005) return "~0.0%";
59 if (cpu < 10) return cpu.toFixed(2) + "%";
60 if (cpu < 100) return cpu.toFixed(1) + "%";
61 if (cpu < 1000) return " " + Math.floor(cpu).toString() + "%";
62 return Math.floor(cpu).toString() + "%";
63}
64
65function fmtLoad(load: number): string {
66 if (load == null) return " ";

Callers 1

processviewer.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected