MCPcopy
hub / github.com/nestjs/nest / fmtPct

Function fmtPct

tools/benchmarks/src/main.ts:184–188  ·  view source on GitHub ↗
(p: number | null, digits = 1)

Source from the content-addressed store, hash-verified

182}
183
184function fmtPct(p: number | null, digits = 1): string {
185 if (p == null) return 'n/a';
186 const sign = p >= 0 ? '+' : '';
187 return `${sign}${p.toFixed(digits)}%`;
188}
189
190function fmtNum(n: number, digits = 2): string {
191 if (!Number.isFinite(n)) return 'n/a';

Callers 1

printComparisonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected