I have strings in currency format which i have to convert to float without using any js library.
2 079,15 EUR
as an example should return 2079.15
Is there a simple way to do it ?
the solution proposed in How to convert a currency string to a double with jQuery or Javascript? is not working in this case:
As it will return
207915
in case of2 079,15 EUR
instead of2079.15
And will return
2079
in case of2 079 EUR
A working solution should return even:
207915
in the 1st case and207900
in the 2nd case or2079.15
in the 1st case and2079
in the 2nd case.The solution : https://stackoverflow.com/a/559178/1086682 works in case of local "US" or "en-GB" but does not work for "FR".