So I have this-
lr_min = $('#lr_min').val().replace(/\D/g,'');
It gets rid of all the nonnumeric characters in the string. How do I exclude periods (.) from this replace?
You can use
lr_min = $('#lr_min').val().replace(/[^\d.]+/g,'');
The +
isn't strictly necessary but will usually give better performances (less replacements)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With