MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / formatNumber

Function formatNumber

app/dashboard/lib/number_formatting_utils.ts:45–56  ·  view source on GitHub ↗
(number: string | number | null | undefined, decimals = 0)

Source from the content-addressed store, hash-verified

43 * Format number with grouping
44 */
45export function formatNumber(number: string | number | null | undefined, decimals = 0): string {
46 if (number == null) return '';
47
48 const num = typeof number === 'string' ? parseFloat(number) : number;
49 if (isNaN(num)) return '';
50
51 return new Intl.NumberFormat('en-US', {
52 maximumFractionDigits: Math.min(Math.max(0, decimals), 20),
53 minimumFractionDigits: decimals,
54 useGrouping: true,
55 }).format(num);
56}
57
58/**
59 * Format price with currency

Callers 8

chart.tsxFile · 0.90
useBillingTooltipContentFunction · 0.90
ProjectCostRowFunction · 0.90
ProjectCostBreakdownFunction · 0.90
OrgManagementDashboardFunction · 0.90
OverviewFunction · 0.90
OverviewStatsComponentFunction · 0.90

Calls 1

formatMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…