"FlutterMoneyFormatter" is a Flutter extension to formatting various types of currencies according to the characteristics you like, without having to be tied to any localization.
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:
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 €.