Im using the parseFloat method to convert a string to a float. it works fine however when the number exceed thousand it one return the value in the thousand place.
So parseFloat('1,022.55')
returns 1
instead of 1022.55
How do i solve this?
Advertisement
Answer
Try:
parseFloat('1,022.55'.replace(/,/g, ''))