MCPcopy Create free account
hub / github.com/DavidHDev/react-bits / formatNumber

Function formatNumber

src/utils/utils.js:15–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13};
14
15const formatNumber = num => {
16 if (num < 1000) return num.toString();
17
18 const rounded = Math.ceil(num / 100) * 100;
19 return new Intl.NumberFormat('en', { notation: 'compact', maximumFractionDigits: 1 }).format(rounded);
20};
21
22export const getStarsCount = async () => {
23 try {

Callers 1

getStarsCountFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected