You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Upon loading up the app for the first time, however, it will use Flutter's NumberFormat.compactSimpleCurrency() library (documented here), which doesn't contain all the necessary information, nor the information for all the countries supported by Paisa, like for example Argentina (the country I live in and I made the PR for yesterday).
I overlooked this issue when I made my PR, and for that I apologize.
The solution I believe would be the best, would be for the list in currency-model.dart to be replaced by the one in country-model.dart. That way, not only many more countries would be added, but also it would be easier to add new ones not already present, not to mention streamlining the process of adding new currencies not supported by the built in NumberFormat library. This would also open the door to the possibility of letting the user add their own custom currency.
Thank you for taking your time to read this, by opening this PR I hope I can help make this amazing app grow by making it just a little better. Cheers!
The text was updated successfully, but these errors were encountered:
EzeKoren
changed the title
Get currency information from your own database instead of the intl library
Get currency information from Paisa's own database instead of the intl library
Mar 22, 2023
When a locale unavailable in the locale list (I.E. Argentina, locale code es_AR) is passed onto this function, after failing to find it, the library will try to trim the locale to just the language (in this case es), which works well for languages but not so much for country information and currencies, since it will return completely wrong information.
That's information already available in the country_model.dart file under the thousands_separator and decimal_separator variables. The first option that comes to mind is to convert the amount of money to a string before displaying it to the user, and replacing both separators with whatever is declared in the country model.
Currently Paisa has a list of country models, where it could reference any listed country's currency's name, symbol, code, and more.
https://github.com/RetroMusicPlayer/Paisa/blob/078de31ded9c45574aa3fa605fdd7f71a69c07f3/lib/src/data/currencies/models/country_model.dart#L561-L573
Upon loading up the app for the first time, however, it will use Flutter's
NumberFormat.compactSimpleCurrency()
library (documented here), which doesn't contain all the necessary information, nor the information for all the countries supported by Paisa, like for example Argentina (the country I live in and I made the PR for yesterday).I overlooked this issue when I made my PR, and for that I apologize.
The solution I believe would be the best, would be for the list in
currency-model.dart
to be replaced by the one incountry-model.dart
. That way, not only many more countries would be added, but also it would be easier to add new ones not already present, not to mention streamlining the process of adding new currencies not supported by the built inNumberFormat
library. This would also open the door to the possibility of letting the user add their own custom currency.Thank you for taking your time to read this, by opening this PR I hope I can help make this amazing app grow by making it just a little better. Cheers!
The text was updated successfully, but these errors were encountered: