Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String getFormattedCurrency(String currencyCode, String currencyName, Number value) {
- //....
- NumberFormat format = NumberFormat.getCurrencyInstance(Locale.getDefault());
- Currency currency = Currency.getInstance(currencyCode);
- format.setCurrency(currency);
- if (format instanceof DecimalFormat) {
- format.setMinimumFractionDigits(CURRENCY_MIN_FRACTION_DIGITS);
- }
- Log.d("Currency", "Symbol: " + currency.getSymbol() + ", Currency: " + currency + ", Locale: " + local);
- return format.format(value);
- }
Add Comment
Please, Sign In to add comment