MCPcopy Index your code
hub / github.com/code-pushup/cli / roundDecimals

Function roundDecimals

packages/utils/src/lib/formatting.ts:11–14  ·  view source on GitHub ↗
(value: number, maxDecimals: number)

Source from the content-addressed store, hash-verified

9export const UNICODE_ELLIPSIS = '…';
10
11export function roundDecimals(value: number, maxDecimals: number) {
12 const multiplier = Math.pow(10, maxDecimals);
13 return Math.round(value * multiplier) / multiplier;
14}
15
16export function slugify(text: string): string {
17 return text

Callers 5

createRunnerFunctionFunction · 0.90
formatBytesFunction · 0.85
formatDurationFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected