I am using javascript and I've seen some ways to convert a currency to a number, but not one that is flexible to understand multiple input formats (decimal separator changes based on the user preference).
Let me show what I mean:
Some possible inputs (String or Number):
- "1.000,50"
- "$1.000,50"
- "1,000.50"
- "$1,000.50"
- 1000.50
Output (Number):
- 1000.50