replace(/[^0-9//-//.]/g, "");
The expression will strip out any of the non-numeric characters not allowed in normal decimal arithmetic.
Example of use:
alert("$100,000.00".replace(/[^0-9//-//.]/g, ""));
produces an alert box displaying 100000.00
replace(/[^0-9//-//.]/g, "");
The expression will strip out any of the non-numeric characters not allowed in normal decimal arithmetic.
Example of use:
alert("$100,000.00".replace(/[^0-9//-//.]/g, ""));
produces an alert box displaying 100000.00
No comments:
Post a Comment