MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / round

Function round

packages/common/src/math.ts:3–6  ·  view source on GitHub ↗
(num: number, decimals = 2)

Source from the content-addressed store, hash-verified

1import { isNumber } from 'mathjs';
2
3export const round = (num: number, decimals = 2) => {
4 const factor = 10 ** decimals;
5 return Math.round((num + Number.EPSILON) * factor) / factor;
6};
7
8export const average = (arr: (number | null)[], includeZero = false) => {
9 const filtered = arr.filter(

Callers 15

getPreviousMetricFunction · 0.90
formatFunction · 0.90
computeFunction · 0.90
processCohortDataFunction · 0.90
formatDurationFunction · 0.90
ChartFunction · 0.90
ChartFunction · 0.90
ChartFunction · 0.90
renderLabelFunction · 0.90
ChartFunction · 0.90
progress.tsxFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected