MCPcopy Create free account
hub / github.com/dailydotdev/apps / formatDataTileValue

Function formatDataTileValue

packages/shared/src/lib/numberFormat.ts:49–61  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

47};
48
49export const formatDataTileValue = (value: number): string => {
50 if (typeof value !== 'number' || !Number.isFinite(value)) {
51 return '0';
52 }
53
54 // For numbers less than 10,000, use locale formatting
55 if (value < 10000) {
56 return value.toLocaleString();
57 }
58
59 // For numbers 10,000 and above, use the existing largeNumberFormat logic
60 return largeNumberFormat(value) || '0';
61};

Callers 9

DataTileFunction · 0.90
verificationCopyFunction · 0.90
achievementTitleFunction · 0.90
RaceFunction · 0.90
CommunityPulseFunction · 0.90
GameCenterPageFunction · 0.90
PostAnalyticsPageFunction · 0.90
ToolPage.spec.tsxFile · 0.90

Calls 1

largeNumberFormatFunction · 0.85

Tested by

no test coverage detected