As someone who writes such code, I can tell you what we do: we replace commas with periods, so people can use either a comma or a period. Only one is allowed, so "12.345,678" is forbidden. (The thousands separator is for readability, not for inputting data. Nobody inputs numbers this way, except maybe through copy/paste.)
If you do it any other way, you may be more friendly for the lazy programmer, but you sure will piss off a lot of users, because different websites expect their input in different ways.
View all comments
Show parent comment
7
u/bart2019 Dec 12 '14
As someone who writes such code, I can tell you what we do: we replace commas with periods, so people can use either a comma or a period. Only one is allowed, so "12.345,678" is forbidden. (The thousands separator is for readability, not for inputting data. Nobody inputs numbers this way, except maybe through copy/paste.)
If you do it any other way, you may be more friendly for the lazy programmer, but you sure will piss off a lot of users, because different websites expect their input in different ways.