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

Formatted value is wrong when fractionDigits is set to 0 #7

Closed
aednlaxer opened this issue Sep 17, 2021 · 3 comments
Closed

Formatted value is wrong when fractionDigits is set to 0 #7

aednlaxer opened this issue Sep 17, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@aednlaxer
Copy link

aednlaxer commented Sep 17, 2021

Looks like setting fractionDigits to 0 breaks the result of value() call. These tests demonstrate the issue:

  1. 20_000 is formatted as 2K, expected is 20K:
test('K abbr', () {
    expect(Numeral(20000).value(fractionDigits: 0), equals('20K'));
});
  1. 200_000 is formatted as 2K, expected is 200K:
test('K abbr', () {
    expect(Numeral(200000).value(fractionDigits: 0), equals('200K'));
});
  1. 20_000_000 is formatted as 2M, expected is 20M:
test('M abbr', () {
    expect(Numeral(20000000).value(fractionDigits: 0), equals('20M'));
});
@medz
Copy link
Owner

medz commented Sep 18, 2021

OK,I will release in the next version

@medz medz self-assigned this Sep 18, 2021
@medz medz added the bug Something isn't working label Sep 18, 2021
@medz medz closed this as completed in 86c8994 Sep 18, 2021
@medz
Copy link
Owner

medz commented Sep 18, 2021

@aednlaxer Fixed in version 1.2.5

@aednlaxer
Copy link
Author

Awesome, thanks! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants