An input element contains numbers a where comma or dot is used as decimal separator and space may be used to group thousands like this:
\'1,2\'
What about:
parseFloat(str.replace(' ', '').replace('.', '').replace(',', '.'));