jQuery how to get number from string? -


i have html:

<span class="price-old" style="padding: 2px;">179,00 dkk</span> 

or be:

<span class="price-old" style="padding: 2px;">1.750,00 dkk</span> 

how number?

try this:

parseint($('.price-old').text().replace(/[^0-9.]/g, ""));  //<-- remove parseint() include value after decimal point 

demo


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -