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

    Function getCurrencySymbol

    • Extracts the currency symbol from a price string. Uses Unicode property escapes to match currency symbols. Supports a wide range of international currency symbols.

      Parameters

      • price: string

        The price string to extract the currency symbol from

      Returns any

      The currency symbol if found, undefined otherwise

      getCurrencySymbol('$1000') // Returns '$'
      getCurrencySymbol('1000€') // Returns '€'
      getCurrencySymbol('£99.99') // Returns '£'
      getCurrencySymbol('¥10000') // Returns '¥'
      getCurrencySymbol('₹1500') // Returns '₹'
      getCurrencySymbol('1000') // Returns undefined (no symbol)