I have a text box that will have a currency string in it that I then need to convert that string to a double to perform some operations on it.
\"$1,1
var parseCurrency = function (e) { if (typeof (e) === 'number') return e; if (typeof (e) === 'string') { var str = e.trim(); var value = Number(e.replace(/[^0-9.-]+/g, "")); return str.startsWith('(') && str.endsWith(')') ? -value: value; } return e; }