The decimal point aka marker is the one locale-specific detail in a raw, unformatted number. Currently if, for example, your locale uses comma , for the decimal marker instead of period . the element will display the default period . during keyboard input.
See the useGrouping option for supressing thousands separators, which will leave the decimal marker alone. It will require testing to see how that non-standard decimal marker character performs while editing via keyboard.
I just tried this and neither parseFloat(), nor Number() handle comma as the decimal marker. There are workarounds, obviously. In this case there will be no thousands separators because of useGrouping:false, so it's safe to do the string replacement prior to converting to number. It should really check to see if the correct decimal marker character for the current locale is being used. That will be a small pain, but would allow you to know when to do the string replacement, which would be safer. Thankfully it looks like there are only two options for decimal marker, comma and period:
https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10
The decimal point aka marker is the one locale-specific detail in a raw, unformatted number. Currently if, for example, your locale uses comma
,
for the decimal marker instead of period.
the element will display the default period.
during keyboard input.See the
useGrouping
option for supressing thousands separators, which will leave the decimal marker alone. It will require testing to see how that non-standard decimal marker character performs while editing via keyboard.I just tried this and neither
parseFloat()
, norNumber()
handle comma as the decimal marker. There are workarounds, obviously. In this case there will be no thousands separators because ofuseGrouping:false
, so it's safe to do the string replacement prior to converting to number. It should really check to see if the correct decimal marker character for the current locale is being used. That will be a small pain, but would allow you to know when to do the string replacement, which would be safer. Thankfully it looks like there are only two options for decimal marker, comma and period: https://www.bipm.org/en/committees/cg/cgpm/22-2003/resolution-10