I've tried with replace(/ ./g, '.'); to eliminate the comma before the dot without succes.
Any idea what is wrong?
Thanks.
I presume your complaint is that every character followed by a space is being replaced with a .. This is because . is a wildcard character. Literally, it means "match anything except a newline":
(The dot, the decimal point) matches any single character except the newline characters:
\n \r \u2028or\u2029. (MDN)
You need to escape it if you want to match a literal .:
replace(/ \./g, '.')
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