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

Currency symbol is returning the ISO currency symbol instead of the actual symbol. #826

Open
rsegecin opened this issue Apr 11, 2024 · 1 comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@rsegecin
Copy link

Describe the bug
Currency symbol is returning the ISO currency symbol instead of the actual symbol. Eg. NumberFormat.currency(locale: 'pt_BR') format currency symbol returns BRL instead of "R$", or NumberFormat.currency(locale: 'en_US') format current returns USD instead of "$".

To Reproduce
install intl package (current '0.19.0')

    String? getCurrencySymbol(String currencyCode) {
      try {
        NumberFormat format = NumberFormat.currency(locale: currencyCode);
        String currencySymbol = format.currencySymbol;
        return currencySymbol;
      } catch (e) {
        // Handle error or invalid currency code
        return null;
      }
    }

    print(getCurrencySymbol("en_US"));

it prints the wrong output.

@rsegecin rsegecin added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Apr 11, 2024
@rsegecin
Copy link
Author

rsegecin commented Apr 11, 2024

I've just noticed that "format.simpleCurrencySymbol(format.currencySymbol)" does returns the actual symbol but still the description of format.currencySymbol says it returns For example, "$", "US$", or "€". instead of saying that it returns the ISO currency name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

1 participant