Files
nym/explorer-v2/src/utils/formatBigNumbers.ts
T
Fouad dc88650d6d Explorer V2 (#5548)
* remove pnpm lock file (should only be using yarn)

* Add lefthook configuration for pre-commit checks

* Add explorer-v2 to package.json dependencies

* add explorer v2

* update explorer v2 package name

* + basepath
+ redirect to basepath
+ blog icons refactor
+ icons refactor

* Add Getting Started instructions to README

* fix noise graph bug and line graph UI

* Delete unused translations, clean up console logs

* / test image url

* update yarn.lock

---------

Co-authored-by: RadekSabacky <radek@nymtech.net>
Co-authored-by: windy-ux <75579979+windy-ux@users.noreply.github.com>
Co-authored-by: Yana <iana.matrosova@gmail.com>
Co-authored-by: Mark Sinclair <mmsinclair@users.noreply.github.com>
2025-03-13 11:31:59 +00:00

16 lines
347 B
TypeScript

const defaultOptions: Intl.NumberFormatOptions = {
maximumFractionDigits: 2,
notation: "compact",
compactDisplay: "short",
};
const defaultLocale = "en-US";
export const formatBigNum = (
num: number,
locale = defaultLocale,
opts = defaultOptions,
) => {
return new Intl.NumberFormat(locale, opts || defaultOptions).format(num);
};