workspace with decoupled nostr package

This commit is contained in:
ennmichael
2023-02-11 21:05:46 +01:00
parent 52e0809622
commit 2a211b78a1
260 changed files with 2363 additions and 714 deletions

View File

@ -0,0 +1,14 @@
const intl = new Intl.NumberFormat("en", {
minimumFractionDigits: 0,
maximumFractionDigits: 2,
});
export function formatShort(n: number) {
if (n < 2e3) {
return n;
} else if (n < 1e6) {
return `${intl.format(n / 1e3)}K`;
} else {
return `${intl.format(n / 1e6)}M`;
}
}