Remove Euro Value and money format with JQuery
javascript, jquery, regex
Solution
"€123,453.28".replace(/[^\d.]/g,"") // Replace every non digit char or dot char
// With an empty string.
Live DEMO
So in your code:
var ammountWithoutVat = $("#TxtVatExcluded").val().replace(/[^\d.]/g,"");
var result = (pareseFloat(ammountWithoutVat, 10) / invoicedAmmount) * 100;
Problem
I already know how to get a value from a label, the problem is that its showing something like `€123,453.28` I need to remove the eurosign and the commas to be able to make a calculation. Not remove the decimal point of course ``` $(document).ready(function () { $("#TxtVatExcluded").keypress(function () { var invoicedAmmount = $("#MainContent_VehicleInformationControl_LblInvoicePriceValue").text(); alert(invoicedAmmount); if (invoicedAmmount > 0) { var ammountWithoutVat = $("#TxtVatExcluded").val(); var result = (ammountWithoutVat / invoicedAmmount) * 100; $("#OutputLabel").html(result + " %"); } }); }); ```