JavaScript parseFloat in Different Cultures
Solution 1:
parseFloat
doesn't use your locale's definition, but the definition of a decimal literal.
It only parses .
not ,
I'm brazilian and I have to replace comma with dot before parsing decimal numbers.
parseFloat specification
Solution 2:
No, parseFloat
is specified to parse DecimalLiterals
, which use the dot as decimal separator. It does not depend on the current environment's locale settings.