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
[BUG] format_number and thousands separators #4911
Comments
Please avoid that at all costs. |
|
Haha! Fair enough! A better way is probably setlocale(LC_NUMERIC, "en_GB.UTF-8");
$separator = localeconv()["thousands_sep"];That depends on if you can set the locale based on the user interface language. |
|
That's actually still what I want to avoid at all costs. A random sample of horrific user experiences includes:
So "in the i18n files" is fine provided it means something like a completely separate file parsed by a completely different setting. |
|
I have been slow there, but here is a comment at last @Frenzie : we have a i18n/en, and a i18n/en-US for instance. In those languages, aren't number formatting rules defined by precisely the language and not by something else? |
|
While it's true there's a certain correlation between what's recommended by style guides/standards and languages, in all of Windows, Mac and Linux/BSD it works something like this. That's because anything else provides an atrocious user experience. Whether you want colour or color or couleur and whether you want the first day of the week to be Monday or the time to be 24h or the date format to be dd-mm-yyyy are all completely separate things. |

Describe the bug
Large numbers are formatted in an unexpected way. For example
1,024is rendered as1 024- there is a space rather than a comma.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Different locales have different digit grouping. In the UK, I'd expect to see the
,used to separate out the decimals.Screenshots
Environment information (please complete the following information):
Additional context
The current code is:
I think the number_format should be:
However, you might want to include decimal and thousands separators in the i18n files?
The text was updated successfully, but these errors were encountered: