From bee96ca44e871b0482012be50e8e7686f534c5a3 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 12 Nov 2024 23:36:15 -0800 Subject: lightning bolt --- src/lib/utils.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/lib/utils.ts') 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 => { 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); -- cgit v1.2.3