In javascript val is of amount type like $1,056.89. Now i want val to be performed with arithmetic operations but alert gives me as NaN instead of arithmetic value. if i take off Number then y value is as 1,056.8910 .how can i make val to numeric type and perform arithmetic operations?
var val= document.getElementById('<%= DataItemValue4.ClientID%>').firstChild.nodeValue;
val= val.replace(/^[\s$]+|[\s]+$/g, '');
y = Number(val)+ 10;
alert(y);
can any one help me out with this !
thanking you, michaeld
Remove all non numeric characters and coerce the string to a number: