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

Default money symbol is hardcoded to $ #38

Open
wants to merge 19 commits into
base: dev
Choose a base branch
from

Conversation

michelemazzei
Copy link

Hi, the MoneyFormatter settings loads the default symbol as '$' , so if the user does not specify it, the $ symbol is used.

If you write the following instruction:
MoneyFormatter(amount: 1000).output.symbolOnLeft;

The result would be:
$ 1,000
But, if your locale is , for example, it_IT, the currency should be €.
Of course, you could easly bypass the problem , but it is easer to let the MoneyFormatterSettings class to discover the user's locale settings.

Thus I suggest you to change the MoneyFormatterSettings as follows:

MoneyFormatterSettings({ this.symbol, this.thousandSeparator = ',', this.decimalSeparator = '.', this.symbolAndNumberSeparator = ' ', this.fractionDigits = 2, this.compactFormatType = CompactFormatType.short, }) { symbol ??= NumberFormat.simpleCurrency().currencySymbol; }

In this manner the current symbol is correctly set to €.

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

Successfully merging this pull request may close these issues.

3 participants