Repository navigation
NMA-1200 Buy Swap | Fiat decimal precision - #899
HashEngineering merged 5 commits into
Conversation
| public static String getLocalCurrencySymbol(String currencyCode) { | ||
| NumberFormat numberFormat = NumberFormat.getCurrencyInstance(getDeviceLocale()); | ||
| Currency currency = Currency.getInstance(currencyCode); | ||
| numberFormat.setCurrency(currency); | ||
| return currency.getSymbol(getDeviceLocale()); | ||
| } |
There was a problem hiding this comment.
This will be one merge conflict with Claude's PR:
It is possible for some phones to above old Locale information for certain currencies that have changed (eg Belarus).
public static String getLocaleCurrencyCode(){
Currency currency = Currency.getInstance(getDeviceLocale());
String newCurrencyCode = currency.getCurrencyCode();
if (CurrencyInfo.hasObsoleteCurrency(newCurrencyCode)) {
newCurrencyCode = CurrencyInfo.getUpdatedCurrency(newCurrencyCode);
}
newCurrencyCode = CurrencyInfo.getOtherName(newCurrencyCode);
return newCurrencyCode;
}
There was a problem hiding this comment.
I tried @ClaudeHangui method we need the local currency Symbol and the one claude create return code
There was a problem hiding this comment.
@hadia you can create a data class which holds the symbol and the code, and return that in your case. The Currency class has a method to get the symbol; unless of course (like Belarus for example) this might have also changed.
@HashEngineering it's okay to use getSymbol() for all including Belarus' currency ??
Syn-McJ
left a comment
There was a problem hiding this comment.
Looks fine apart from Eric's comment
…at_decimal_precision
The fiat values should only go out two decimals.
Issue being fixed or feature implemented
Related PR's and Dependencies
Screenshots / Videos
How Has This Been Tested?
Checklist: