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

Function formatDataTileValue

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

Source from the content-addressed store, hash-verified

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

Callers 6

DataTileFunction · 0.90
CampaignListViewFunction · 0.90
countFunction · 0.90
WorldPanelFunction · 0.90
PostAnalyticsPageFunction · 0.90

Calls 1

largeNumberFormatFunction · 0.85

Tested by

no test coverage detected