New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format these numbers so they have the right separator #1257
Conversation
This seems to be based on the operating system language rather than the number formatting. I run Windows with Swedish formatting for dates, numbers, etc but English as the primary language. If we are going to format numbers we should respect the system number locale and I'd expect this to read Contrast this to WPF |
@niik that's interesting. I'd assumed that the locale stuff would be pre-filled like this And here's the region settings to contrast: What's different about your setup that I've missed? EDIT: actually, if the |
That there's several sub-parts of localization. There's language (I'm running en-US) but there's also number formatting, date formatting, currency etc. I'm running with the English language pack but Swedish formatting for currency, numbers, dates etc.
Javascript supports i18n number formatting through Intl.NumberFormat() That also defaults to the browser language though so one would need to provide the appropriate number locale. I don't know how to get a hold of that from js. Complicating things even further the default formats of a locale can be overridden on Windows so I guess the only way to follow platform conventions would be to pull the information from something like GetNumberFormatEx and construct a NumberFormat based on that. |
https://bugs.chromium.org/p/chromium/issues/detail?id=120473 and https://bugs.chromium.org/p/chromium/issues/detail?id=33413 look like the relevant Chromium bugs. Looks like we'd have to write some native code to make this work and I imagine this is something that should be in Electron proper. I opened electron/electron#9247 to track this on the Electron side. |
I'll let @joshaber make the final call on this one but FWIW right now this is actually a step down in usability for me. Say what you want about unformatted integers, they're ubiquitous and well-understood. I'm leaning towards trying to solve this properly. |
I was planning to defer to @niik, so it sounds like we should wait and Do It Right. |
🚮 |
Fixes #1245