MCPcopy Create free account
hub / github.com/sqlchat/sqlchat / getCurrencySymbol

Function getCurrencySymbol

src/utils/misc.ts:1–13  ·  view source on GitHub ↗
(currencyCode: string)

Source from the content-addressed store, hash-verified

1export const getCurrencySymbol = (currencyCode: string): string => {
2 try {
3 return new Intl.NumberFormat("en-US", {
4 style: "currency",
5 currency: currencyCode,
6 })
7 .formatToParts(1)
8 .find((part) => part.type === "currency")!.value;
9 } catch (error) {
10 console.error(`Invalid currency code: ${currencyCode}`);
11 return "";
12 }
13};
14
15export const getDateString = (timeStamp = Date.now()): string => {
16 const dateOptions: Intl.DateTimeFormatOptions = {

Callers 1

PaymentHistoryTableFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected