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

Function formatEventsCount

apps/public/src/lib/utils.ts:8–16  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

6}
7
8export const formatEventsCount = (value: number) => {
9 if (value >= 1_000_000) {
10 return `${(value / 1_000_000).toFixed(1)}M`;
11 }
12 if (value >= 1_000) {
13 return `${(value / 1_000).toFixed(0)}K`;
14 }
15 return value.toString();
16};

Callers 2

PricingFunction · 0.90
PricingTableFunction · 0.90

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected