MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / formatStars

Function formatStars

apps/public/src/components/github-button.tsx:6–12  ·  view source on GitHub ↗
(stars: number)

Source from the content-addressed store, hash-verified

4import { Button } from './ui/button';
5
6function formatStars(stars: number) {
7 if (stars >= 1000) {
8 const k = stars / 1000;
9 return `${k.toFixed(k >= 10 ? 0 : 1)}k`;
10 }
11 return stars.toString();
12}
13
14export function GithubButton() {
15 const [stars, setStars] = useState(4_800);

Callers 1

GithubButtonFunction · 0.85

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected