What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-17 06:03:03
convert string with dot or comma as decimal separator to number in javascript
function realParseFloat(s) { s = s.replace(/[^\d,.-]/g, ''); // strip everything except numbers, dots, commas and negative sign if (navigator.language.substring(0, 2) !== "de" && /^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(s)... Add solution
Best helpers
Ranking is empty