@pathmaker-digital/pmd-utilities - v2.2.6
    Preparing search index...

    Function parseCurrency

    • Parses a currency string (like "$1,234.56") into a number.

      Parameters

      • currencyString: string

        The formatted currency string.

      Returns number

      A numeric value extracted from the string.

      const amount = parseCurrency("$1,234.56");
      console.log(amount); // Output: 1234.56
      const negative = parseCurrency("($500.00)");
      console.log(negative); // Output: -500 (if formatted correctly)