jquery - How to remove unicode Hex character in javascript? -
in javascript code given below, going multiply 2 variables. gives nan result of multiplication now.
i alerted 2 variables going multiplied. 1 variable integer. variable contains rupee symbol (₹) decimal value. need remove symbol variable.
i have tried below code remove unicode characters variable.
price_per_day = price_per_day.replace(/[\ue000-\uf8ff]/g, '');
but showing nan after multiplication.
total_days=10; price_per_day = price_per_day.replace(/[\ue000-\uf8ff]/g, ''); var total_amount = parsefloat(price_per_day) * total_days;
instead of replacing symbol, extract money
var price = document.getelementbyid("price").innerhtml.replace(/[^0-9.,]/g,""); alert(price)
<span id="price"> ₹ 50.99</span>
Comments
Post a Comment