On Monday, June 29, 2020 at 11:34:09 PM UTC+7, Martin Blais wrote: > One of the things we might want to do for v3 is make it possible to > specify the locale within Beancount itself (insulating it from its > environment) and perhaps bring back the checks (simply removing the commas > works). OTOH, right now we don't support decimal commas. Ideally we support > all this in v3. >
Handling locales is tricky. The locale is (kinda sorta) tied to the currency. I use multiple currencies. One is USD but the other is VND which is officially defined with "decimal commas" for thousands separators and "comma decimals" for fraction separators. Which one should I use in a given entry? It might seem obvious -- "let the user pick one and then everything is in that" -- and that might work if all data was user-generated. But the reality is that much of our data comes from external sources and all of them will generate data in their native, expected format. My US bank will export CSVs one way and my Vietnamese bank will export CSVs in another. I'm not sure we want beancount importers and price fetchers to have to parse the user file to lookup their locale to know what format to emit things in. (And unless doing so was made super easy for 3rd party authors of importers and price fetchers it seems likely that few would bother and would simply emit "raw" numbers which would work for 99% of users but be completely broken for others.) Allowing individual files to have their own locale would allow us to work around that maybe. My Yahoo price fetcher gets redirected to a file with an en_US header. My WellsFargo importer gets redirected to a file with an en_US header. My VietcomBank importer gets redirected to a file with a vi_VN header. Maybe that doesn't complicate the parser and importer too much? Still, it feels like a less than great solution, too, so I'm not thrilled with that proposal either. -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/9e8c6d9b-66d5-42bf-8fcf-4b706695213fo%40googlegroups.com.
