Parses a currency string (like "$1,234.56") into a number.
The formatted currency string.
A numeric value extracted from the string.
const amount = parseCurrency("$1,234.56");console.log(amount); // Output: 1234.56 Copy
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) Copy
const negative = parseCurrency("($500.00)");console.log(negative); // Output: -500 (if formatted correctly)
Parses a currency string (like "$1,234.56") into a number.