ChemPal Documentation - v1.7.0
    Preparing search index...

    Variable CURRENCY_CODE_MAPConst

    CURRENCY_CODE_MAP: { [key: string]: string } = ...

    Mapping of currency symbols to their corresponding currency codes. Several currencies share a symbol (e.g. "$" → USD/SRD, "£" → GBP/GIP/…); the library lists the major currency first, so we keep the first code seen for each symbol ("first wins") to resolve "$" → USD, "£" → GBP, "₩" → KRW.

    Type declaration

    • [key: string]: string
    CURRENCY_CODE_MAP['$'] // returns 'USD'
    CURRENCY_CODE_MAP['₹'] // returns 'INR'
    export const CURRENCY_CODE_MAP: { [key: string]: string } = Object.entries(CURRENCY_INFO).reduce<{
    [key: string]: string;
    }>(
    (map, [code, { symbol }]) => {
    if (!(symbol in map)) {
    map[symbol] = code;
    }
    return map;
    },
    { ...CURRENCY_CODE_OVERRIDES },
    );