Skip to content
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

Missing number grouping for small numbers #12

Open
ShadowJack opened this issue Nov 12, 2020 · 0 comments
Open

Missing number grouping for small numbers #12

ShadowJack opened this issue Nov 12, 2020 · 0 comments

Comments

@ShadowJack
Copy link

Hello,
it looks like a number grouping functionality works incorrectly in the edge case:

var version = await Cldr.Instance.DownloadLatestAsync(); // version: 38.0

var locale = Locale.Create("en"); // locale: en-Latn-US
var formatter = NumberFormatter.Create(locale); // formatter.Options.UseGrouping: true, formatter.Symbols.Group: ","

Console.WriteLine($"{formatter.Format(1000)}");

For en-Latn-US locale minimumGroupingDigits is 1 and decimalFormat pattern is #,##0.###.
So according to Numbering Systems and Number and currency patterns docs, 1,000 must be printed out, but 1000 is printed instead.

I guess the problem is here:

useGrouping = nDigits > minDigits;

should be

useGrouping = nDigits >= minDigits;

Please check, maybe I misunderstood the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant