MCPcopy Create free account
hub / github.com/codename-co/stack / formatStars

Function formatStars

packages/website/src/helpers/format.ts:18–29  ·  view source on GitHub ↗
(stars?: number, lang?: string)

Source from the content-addressed store, hash-verified

16};
17
18export const formatStars = (stars?: number, lang?: string) => {
19 if (!stars) {
20 return "Unknown";
21 }
22
23 return Intl.NumberFormat(lang, {
24 minimumFractionDigits: 1,
25 maximumFractionDigits: 1,
26 notation: "compact",
27 trailingZeroDisplay: "stripIfInteger",
28 }).format(stars);
29};
30
31import { format as timeagojs, register } from "timeago.js";
32import {

Callers 1

CardFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected