Skip to content

Default money symbol is hardcoded to $#38

Open
michelemazzei wants to merge 21 commits intofadhly-permata:devfrom
wiseminds:dev
Open

Default money symbol is hardcoded to $#38
michelemazzei wants to merge 21 commits intofadhly-permata:devfrom
wiseminds:dev

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