diff options
| author | Adam Soltys <[email protected]> | 2024-11-12 23:36:15 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-11-12 23:36:15 -0800 |
| commit | bee96ca44e871b0482012be50e8e7686f534c5a3 (patch) | |
| tree | 8eee96b61e7996b0b5f94b596391949825a39b45 /src/lib/utils.ts | |
| parent | e6742ec5b333e5b3b7d174eae9f79c7d63b4b4e9 (diff) | |
| download | coinos-ui-bee96ca44e871b0482012be50e8e7686f534c5a3.tar.gz coinos-ui-bee96ca44e871b0482012be50e8e7686f534c5a3.zip | |
lightning bolt
Diffstat (limited to 'src/lib/utils.ts')
| -rw-r--r-- | src/lib/utils.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 9830844a..f6b11df0 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -200,12 +200,15 @@ export const fd = async (req: Request): Promise<any> => { return obj; }; -export const f = (s: number): string => +export const f = (s: number, currency: string): string => new Intl.NumberFormat("en-US", { - style: "decimal", + style: "currency", + currency, minimumFractionDigits: 2, maximumFractionDigits: 2, - }).format(s); + }) + .format(s) + .replace("CA", ""); export const s = (s: number): string => new Intl.NumberFormat("en-US", { maximumFractionDigits: 0 }).format(s); |
