MCPcopy
hub / github.com/cursor/community-plugins / formatCount

Function formatCount

apps/cursor/src/lib/utils.ts:28–33  ·  view source on GitHub ↗
(n: number)

Source from the content-addressed store, hash-verified

26}
27
28export function formatCount(n: number): string {
29 if (n >= 1_000_000)
30 return `${(n / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`;
31 if (n >= 1_000) return `${(n / 1_000).toFixed(1).replace(/\.0$/, "")}k`;
32 return String(n);
33}
34
35export function generateNameAbbr(name: string): string {
36 const firstCharRegex = /[\p{L}]/u;

Callers 9

HeroTitleFunction · 0.90
ProfileHeaderFunction · 0.90
MoreRowFunction · 0.90
PluginLeaderboardFunction · 0.90
PluginDetailViewFunction · 0.90
PluginCardFunction · 0.90
MembersCardFunction · 0.90
MembersPageContentFunction · 0.90
renderImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected