ChemPare Documentation - v0.0.0
    Preparing search index...

    Function getCurrencyCodeFromSymbol

    • Maps a currency symbol to its corresponding ISO currency code. Uses a predefined mapping from the CURRENCY_CODE_MAP constant. Supports major international currency symbols.

      Parameters

      • symbol: valueof

        The currency symbol to look up (e.g., '$', '€', '£')

      Returns valueof

      The corresponding ISO currency code (e.g., 'USD', 'EUR', 'GBP')

      getCurrencyCodeFromSymbol('$') // Returns 'USD'
      getCurrencyCodeFromSymbol('€') // Returns 'EUR'
      getCurrencyCodeFromSymbol('£') // Returns 'GBP'
      getCurrencyCodeFromSymbol('¥') // Returns 'JPY'
      getCurrencyCodeFromSymbol('₹') // Returns 'INR'

      // Useful in combination with getCurrencySymbol
      const symbol = getCurrencySymbol('$100');
      const code = getCurrencyCodeFromSymbol(symbol); // 'USD'