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

Function formatDataTileValue

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

Source from the content-addressed store, hash-verified

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

Callers 4

DataTileFunction · 0.90
CampaignListViewFunction · 0.90
PostAnalyticsPageFunction · 0.90

Calls 1

largeNumberFormatFunction · 0.85

Tested by

no test coverage detected