I have the following string ‘1 234’ and I would like to parse it to float.
I have tried varios of solutions but none of them works for me.
I have tried:
parseFloat('1 234'.trim())
parseFloat('1 234'.split(' ').join())
parseFloat('1 234'.replace(/ /g, ''))
2
Answers
This should do it:
Maybe you can try this: