5 ms·
Iostreams aside: You're absolutely right with the trashfire. I live in a country where the elders of the language decided that we don't format floating point n
by PandaPanda150 5y ago
Iostreams aside: You're absolutely right with the trashfire.
I live in a country where the elders of the language decided that we don't format floating point numbers with a decimal point but use a decimal komma instead.
So PI is not 3.14 but 3,14 instead.
Just imagine what pain you have to go through if you want to parse a .csv file written by an application that "tried to do everything right and use locale".
- MaxBarraclough 5y ago> So PI is not 3.14 but 3,14 instead. How would you write 3,141.592?
- selfmodruntime 5y ago3.141,592 - Germany formats numbers that way.
- deleted 5y ago[deleted]
- vidarh 5y agoNorway as well
- pilif 5y agoHere in Switzerland it's even worse because it depends on where in Switzerland you're formatting the number (French parts have different rules from German parts) and whether you're formatting a number as a plain number or a monetary value. if it's money, you use the . as the decimal separator everywhere. if it's just a number, in the French parts, it's , in the German parts the . The thousands separator is ' everywhere
- zmmmmm 5y agosurely this must routinely cause horrific mistakes in things like bank transactions?
- gray_-_wolf 5y agoIn my country most people do not really use thousands separator, so here it would be either 3141,592 or 3 141,592.
- throwaway2016a 5y agoAt least in currencies it is very common to use space as a thousands separator.
- ur-whale 5y ago3'141,592
- gumby 5y agoNote that some languages don't follow the "break at thousand, million.." pattern, most notably south asian languages that break at the lakh and crore boundaries.
- hashimotonomora 5y ago3141592 thousandths. Integer is beautiful.
- trulyme 5y agoUgh. Locales should be used for (user faced) input / output, never for saving data internally or for exporting it. Well, there are some exceptions, like actually caring about the original datetime, but they are rare.
- mananaysiempre 5y ago> Just imagine what pain you have to go through if you want to parse a .csv file written by an application that "tried to do everything right and use locale". Microsoft Excel will helpfully use semicolons as field separators in this case, making parsing CSVs that came out of it in an unknown locale situation even more fun!