Get numeric value from Alphanumeric value with jQuery
TO get the numeric value from string we used RegEx. It filter the numeric value.
var actualPrice = 'Product price is $2.99 each'; var price = Number(actualPrice.replace(/[^0-9\.]+/g,"")); //Result is 2.99
Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes1
No0