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

Library unusable on Dutch locale #18

Open
LugonjaAleksandar opened this issue Nov 21, 2019 · 1 comment
Open

Library unusable on Dutch locale #18

LugonjaAleksandar opened this issue Nov 21, 2019 · 1 comment

Comments

@LugonjaAleksandar
Copy link

When switching away from regular number format seen in English locale, to for example Dutch there is an issue with "flutter_money_formatter_base.dart" file that crashes when trying to parse a number that can't be parsed. Specific line that crashes is:

crashScreenshot

.format(num.parse(numerics));

To Reproduce
Steps to reproduce the behavior:

  1. Enter decimal value and switch to Dutch locale in Flutter app

Expected behavior
I expect that locale for decimal and thousands separator is respected, but I get crash.

Smartphone (please complete the following information):

  • any device Android or iOS. This is not phone specific.
@LugonjaAleksandar LugonjaAleksandar changed the title Dutch locale doesn't work with decimals at all Library unusable on Dutch locale Nov 21, 2019
@autlunatic
Copy link

autlunatic commented Dec 3, 2019

On german Locale it also shows this error.
I have found out that at least one Problem lies in the BaseCompact Format function in the utilities unit:

 NumberFormat get baseCompact =>
      this.settings.compactFormatType == CompactFormatType.short
          ? NumberFormat.compact()
          : NumberFormat.compactLong();

In my simple test it was working when i force the locale of en_US on the NumberFormat constructors

NumberFormat get baseCompact =>
     this.settings.compactFormatType == CompactFormatType.short
         ? NumberFormat.compact(locale:'en_US')
         : NumberFormat.compactLong(locale:'en_US');

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

2 participants