MCPcopy Create free account
hub / github.com/LevelUpWeb3/app / formatLargeNumber

Function formatLargeNumber

src/utils/common.ts:46–54  ·  view source on GitHub ↗
(value: number)

Source from the content-addressed store, hash-verified

44};
45
46export const formatLargeNumber = (value: number): string => {
47 if (value.toString().length <= 6) {
48 return new Intl.NumberFormat("en-US").format(value);
49 }
50 return new Intl.NumberFormat("en-US", {
51 maximumFractionDigits: 1,
52 notation: "compact",
53 }).format(value);
54};
55
56export const formatAmount = (value: number | string): string => {
57 return new Intl.NumberFormat("en-US").format(+value);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected