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 (&#x20b9) 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">    &#x20b9; 50.99</span>


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -