Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/code100x/cms
/ formatNumber
Function
formatNumber
src/components/posts/PostCard.tsx:93–98 ·
view source on GitHub ↗
(num: number)
Source
from the content-addressed store, hash-verified
91
};
92
93
const formatNumber = (num: number) => {
94
if (num >= 1000) {
95
return `${(num / 1000).toFixed(1).replace(/\.0$/,
''
)}K`;
96
}
97
return num.toString();
98
};
99
100
return (
101
<div
Callers
1
PostCard
Function · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected