aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-11-29 21:31:25 -0800
committerAdam Soltys <[email protected]>2024-11-29 21:31:25 -0800
commit644d7963b8d108304ba75bb87cacadab66199feb (patch)
tree5dcffee7b489f193dd7ff4ae234f5f1d9c356fab /src/lib/utils.ts
parentc43d415f3b473367b5de44fd0719241961cb740d (diff)
downloadcoinos-ui-644d7963b8d108304ba75bb87cacadab66199feb.tar.gz
coinos-ui-644d7963b8d108304ba75bb87cacadab66199feb.zip
try service worker again
Diffstat (limited to 'src/lib/utils.ts')
-rw-r--r--src/lib/utils.ts11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/lib/utils.ts b/src/lib/utils.ts
index cb18d32c..9cf87277 100644
--- a/src/lib/utils.ts
+++ b/src/lib/utils.ts
@@ -98,15 +98,6 @@ export const copyNoNewlines = (text: string) => {
success("Copied!");
};
-export function reverseFormat(val: string, locale: string): number {
- const parts = new Intl.NumberFormat(locale).formatToParts(1111.1);
- const group = parts.find((part) => part.type === "group")?.value;
- const decimal = parts.find((part) => part.type === "decimal")?.value;
- let reversedVal = val.replace(new RegExp(`\\${group}`, "g"), "");
- reversedVal = reversedVal.replace(new RegExp(`\\${decimal}`, "g"), ".");
- return Number.isNaN(reversedVal) ? 0 : +reversedVal;
-}
-
export const protectedRoutes: RegExp[] = [/customers/, /settings/, /payments/];
let recent: string[] = [];
@@ -289,7 +280,7 @@ export const f = (
) =>
new Intl.NumberFormat(locale, {
style: "currency",
- currency,
+ currency: currency || "USD",
minimumFractionDigits,
maximumFractionDigits,
}).format(s);