Default money symbol is hardcoded to $#38
Open
michelemazzei wants to merge 21 commits intofadhly-permata:devfrom
Open
Default money symbol is hardcoded to $#38michelemazzei wants to merge 21 commits intofadhly-permata:devfrom
michelemazzei wants to merge 21 commits intofadhly-permata:devfrom
Conversation
some improvements
increased version number for intl
Migrated to nullsafety
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,000But, 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 €.