diff --git a/commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java b/commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java index 999b42666..fb8a4a625 100644 --- a/commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java +++ b/commonui/src/main/java/com/hyperwallet/android/ui/common/util/CurrencyParser.java @@ -1,7 +1,5 @@ package com.hyperwallet.android.ui.common.util; -import static com.hyperwallet.android.model.transfer.Transfer.EMPTY_STRING; - import android.content.Context; import androidx.annotation.VisibleForTesting; @@ -18,17 +16,21 @@ import java.text.NumberFormat; import java.util.ArrayList; import java.util.Currency; +import java.util.HashMap; import java.util.List; +import java.util.Locale; public class CurrencyParser { private static CurrencyParser instance; private static final String CURRENCY_LIST = "currency.json"; - private List currencyList; + private final List currencyList; + private final HashMap localeList = new HashMap<>(); private static final String REGEX_REMOVE_EMPTY_SPACE = "^\\s+|\\s+$"; private CurrencyParser(Context context) { currencyList = populateCurrencyList(readJSONFromAsset(context)); + setLocaleList(); } public static CurrencyParser getInstance(Context context) { @@ -74,21 +76,6 @@ private List populateCurrencyList(String currencyList) { return mCurrencyDetailsList; } - /** - * Formats the currency as per currency code. - * - * @param currency Any currency symbol. - * @param amount Any valid number in decimal. - * @return Returns the formatted number as per currency. - */ - public String formatCurrency(String currency, String amount) { - int numberOfFractions = getNumberOfFractionDigits(currency); - NumberFormat format = NumberFormat.getCurrencyInstance(); - format.setMinimumFractionDigits(numberOfFractions); - format.setCurrency(Currency.getInstance(currency)); - return format.format(Double.parseDouble(amount)); - } - @VisibleForTesting int getNumberOfFractionDigits(String currencyCode) { for (CurrencyDetails list : currencyList) { @@ -109,15 +96,21 @@ int getNumberOfFractionDigits(String currencyCode) { */ public String formatCurrencyWithSymbol(String currency, String amount) { - DecimalFormat currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance(); + DecimalFormat currencyFormatter; + if(localeList.containsKey(currency)) { + LocaleDetails locale = localeList.get(currency); + currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance((new Locale(locale.getLanguage(),locale.getCountryCode()))); + }else { + currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance(); + } CurrencyDetails currencyDetails = getCurrency(currency); currencyFormatter.setMinimumFractionDigits(currencyDetails == null ? 0 : currencyDetails.getDecimals()); currencyFormatter.setCurrency(Currency.getInstance(currency)); DecimalFormatSymbols decimalFormatSymbols = currencyFormatter.getDecimalFormatSymbols(); decimalFormatSymbols.setCurrencySymbol(""); currencyFormatter.setDecimalFormatSymbols(decimalFormatSymbols); - String formattedAmount = currencyFormatter.format(Double.parseDouble(amount)).replaceAll(REGEX_REMOVE_EMPTY_SPACE, EMPTY_STRING); - return currencyDetails == null ? "" : currencyDetails.getSymbol() + formattedAmount; + String formattedAmount = currencyFormatter.format(Double.parseDouble(amount)); + return currencyDetails == null ? "" : currencyDetails.getSymbol() + formattedAmount.trim(); } public CurrencyDetails getCurrency(String currencyCode) { @@ -129,6 +122,105 @@ public CurrencyDetails getCurrency(String currencyCode) { return null; } + /** + * + */ + public void setLocaleList() { + localeList.clear(); + localeList.put("AED",new LocaleDetails("en","AE")); + localeList.put("ALL",new LocaleDetails("en","US")); + localeList.put("AMD",new LocaleDetails("hy","AM")); + localeList.put("ARS",new LocaleDetails("es","AR")); + localeList.put("AUD",new LocaleDetails("en","AU")); + localeList.put("BAM",new LocaleDetails("hr","BA")); + localeList.put("BDT",new LocaleDetails("en","BD")); + localeList.put("BGN",new LocaleDetails("bg","BG")); + localeList.put("BHD",new LocaleDetails("en","US")); + localeList.put("BOB",new LocaleDetails("qu","BO")); + localeList.put("BRL",new LocaleDetails("en","BR")); + localeList.put("BWP",new LocaleDetails("en","BW")); + localeList.put("CAD",new LocaleDetails("en","CA")); + localeList.put("CHF",new LocaleDetails("en","CH")); + localeList.put("CLP",new LocaleDetails("es","CL")); + localeList.put("CNH",new LocaleDetails("en","CN")); + localeList.put("CNY",new LocaleDetails("en","CN")); + localeList.put("COP",new LocaleDetails("es","CO")); + localeList.put("CZK",new LocaleDetails("cs","CZ")); + localeList.put("DKK",new LocaleDetails("en","DK")); + localeList.put("EEK",new LocaleDetails("en","US")); + localeList.put("EGP",new LocaleDetails("en","US")); + localeList.put("ETB",new LocaleDetails("so","ET")); + localeList.put("EUR",new LocaleDetails("es","EA")); + localeList.put("FJD",new LocaleDetails("en","FJ")); + localeList.put("GBP",new LocaleDetails("kw","GB")); + localeList.put("GHS",new LocaleDetails("ee","GH")); + localeList.put("GMD",new LocaleDetails("en","GM")); + localeList.put("HKD",new LocaleDetails("en","HK")); + localeList.put("HRK",new LocaleDetails("es","HR")); + localeList.put("HUF",new LocaleDetails("hu","HU")); + localeList.put("IDR",new LocaleDetails("jv","ID")); + localeList.put("ILS",new LocaleDetails("he","IL")); + localeList.put("INR",new LocaleDetails("en","IN")); + localeList.put("ISK",new LocaleDetails("en","US")); + localeList.put("JMD",new LocaleDetails("en","JM")); + localeList.put("JOD",new LocaleDetails("en","us")); + localeList.put("JPY",new LocaleDetails("en","JP")); + localeList.put("KES",new LocaleDetails("guz","KE")); + localeList.put("KHR",new LocaleDetails("km","KH")); + localeList.put("KRW",new LocaleDetails("en","KR")); + localeList.put("KWD",new LocaleDetails("en","US")); + localeList.put("KZT",new LocaleDetails("ru","KZ")); + localeList.put("LAK",new LocaleDetails("lo","LA")); + localeList.put("LKR",new LocaleDetails("ta","LK")); + localeList.put("LSL",new LocaleDetails("en","US")); + localeList.put("MAD",new LocaleDetails("zgh","MA")); + localeList.put("MGA",new LocaleDetails("en","MG")); + localeList.put("MRU",new LocaleDetails("ff","MR")); + localeList.put("MUR",new LocaleDetails("en","MU")); + localeList.put("MWK",new LocaleDetails("en","MW")); + localeList.put("MXN",new LocaleDetails("en","MX")); + localeList.put("MYR",new LocaleDetails("en","MY")); + localeList.put("MZN",new LocaleDetails("mgh","MZ")); + localeList.put("NAD",new LocaleDetails("af","NA")); + localeList.put("NGN",new LocaleDetails("en","NG")); + localeList.put("NOK",new LocaleDetails("nn","NO")); + localeList.put("NPR",new LocaleDetails("en","US")); + localeList.put("NZD",new LocaleDetails("en","PN")); + localeList.put("OMR",new LocaleDetails("ae","OM")); + localeList.put("PEN",new LocaleDetails("en","PE")); + localeList.put("PGK",new LocaleDetails("en","PG")); + localeList.put("PHP",new LocaleDetails("ceb","PH")); + localeList.put("PKR",new LocaleDetails("en","PK")); + localeList.put("PLN",new LocaleDetails("pl","PL")); + localeList.put("QAR",new LocaleDetails("en","US")); + localeList.put("RON",new LocaleDetails("ro","RO")); + localeList.put("RSD",new LocaleDetails("sr","Latn_RS")); + localeList.put("RUB",new LocaleDetails("ru","RU")); + localeList.put("SBD",new LocaleDetails("en","SB")); + localeList.put("SEK",new LocaleDetails("en","SE")); + localeList.put("SGD",new LocaleDetails("ta","SG")); + localeList.put("SVG",new LocaleDetails("en","US")); + localeList.put("SZL",new LocaleDetails("en","SZ")); + localeList.put("THB",new LocaleDetails("th","TH")); + localeList.put("TND",new LocaleDetails("en","TN")); + localeList.put("TOP",new LocaleDetails("to","TO")); + localeList.put("TRY",new LocaleDetails("tr","TR")); + localeList.put("TWD",new LocaleDetails("zh","TW")); + localeList.put("UGX",new LocaleDetails("cgg","UG")); + localeList.put("USD",new LocaleDetails("es","US")); + localeList.put("UYU",new LocaleDetails("es","UY")); + localeList.put("VND",new LocaleDetails("vi","VN")); + localeList.put("VUV",new LocaleDetails("en","VU")); + localeList.put("WST",new LocaleDetails("en","WS")); + localeList.put("XPF",new LocaleDetails("fr","PF")); + localeList.put("ZAR",new LocaleDetails("en","ZA")); + localeList.put("ZMW",new LocaleDetails("en","ZM")); + } + + public HashMap getLocaleList() + { + return localeList; + } /** * truncate decimals for given value * diff --git a/commonui/src/main/java/com/hyperwallet/android/ui/common/util/LocaleDetails.java b/commonui/src/main/java/com/hyperwallet/android/ui/common/util/LocaleDetails.java new file mode 100644 index 000000000..ec99a3f65 --- /dev/null +++ b/commonui/src/main/java/com/hyperwallet/android/ui/common/util/LocaleDetails.java @@ -0,0 +1,19 @@ +package com.hyperwallet.android.ui.common.util; + +public class LocaleDetails { + private String language; + private String countryCode; + + public LocaleDetails(String language, String countryCode) { + this.language = language; + this.countryCode = countryCode; + } + + public String getLanguage() { + return language; + } + + public String getCountryCode() { + return countryCode; + } +} diff --git a/commonui/src/test/java/com/hyperwallet/android/ui/common/util/CurrencyParserTest.java b/commonui/src/test/java/com/hyperwallet/android/ui/common/util/CurrencyParserTest.java index 86c17a85c..0c100c89d 100644 --- a/commonui/src/test/java/com/hyperwallet/android/ui/common/util/CurrencyParserTest.java +++ b/commonui/src/test/java/com/hyperwallet/android/ui/common/util/CurrencyParserTest.java @@ -20,62 +20,62 @@ public class CurrencyParserTest { private Map currenciesMap = new HashMap() { { - put("ALL", "ALL1,000,000.00"); // Albania Currency - put("ARS", "ARS1,000,000.00"); // Argentina Currency - put("AMD", "AMD1,000,000.00"); // Armenia Currency - put("AUD", "AUD1,000,000.00"); // Australia Currency - put("BDT", "BDT1,000,000.00"); // Bangladesh Currency - put("BRL", "BRL1,000,000.00"); // Brazil Currency - put("BGN", "BGN1,000,000.00"); // Bulgaria Currency - put("KHR", "KHR1,000,000.00"); // Cambodia Currency - put("CAD", "CAD1,000,000.00"); // Canada Currency - put("CLP", "CLP1,000,000"); // Chile Currency - put("CNY", "CNY1,000,000.00"); // China Currency - put("COP", "COP1,000,000.00"); // Colombia Currency - put("HRK", "HRK1,000,000.00"); // Croatia Currency - put("CZK", "CZK1,000,000.00"); // Czech Republic Currency - put("DKK", "DKK1,000,000.00"); // Denmark Currency - put("EGP", "EGP1,000,000.00"); // Egypt Currency - put("EUR", "EUR1,000,000.00"); // Austria Currency - put("HKD", "HKD1,000,000.00"); // Hong Kong Currency - put("HUF", "HUF1,000,000.00"); // Hungary Currency - put("INR", "INR1,000,000.00"); // India Currency - put("IDR", "IDR1,000,000"); // Indonesia Currency - put("JMD", "JMD1,000,000.00"); // Jamaica Currency - put("JPY", "JPY1,000,000"); // Japan Currency - put("JOD", "JOD1,000,000.00"); // Jordan Currency - put("KZT", "KZT1,000,000.00"); // Kazakhstan Currency - put("KES", "KES1,000,000.00"); // Kenya Currency - put("LAK", "LAK1,000,000.00"); // Laos Currency - put("MYR", "MYR1,000,000.00"); // Malaysia Currency - put("MXN", "MXN1,000,000.00"); // Mexico Currency - put("MAD", "MAD1,000,000.00"); // Morocco Currency - put("ILS", "ILS1,000,000.00"); // Israel Currency - put("TWD", "TWD1,000,000"); // Taiwan Currency - put("TRY", "TRY1,000,000.00"); // Turkey Currency - put("NZD", "NZD1,000,000.00"); // New Zealand Currency - put("NGN", "NGN1,000,000.00"); // Nigeria Currency - put("NOK", "NOK1,000,000.00"); // Norway Currency - put("PKR", "PKR1,000,000.00"); // Pakistan Currency - put("PEN", "PEN1,000,000.00"); // Peru Currency - put("PHP", "PHP1,000,000.00"); // Philippines Currency - put("PLN", "PLN1,000,000.00"); // Poland Currency - put("GBP", "GBP1,000,000.00"); // Isle of Man - put("RON", "RON1,000,000.00"); // Romania Currency - put("RUB", "RUB1,000,000.00"); // Russia Currency - put("RSD", "RSD1,000,000.00"); // Serbia Currency - put("SGD", "SGD1,000,000.00"); // Singapore Currency - put("ZAR", "ZAR1,000,000.00"); // South Africa Currency - put("KRW", "KRW1,000,000"); // South Korea Currency - put("LKR", "LKR1,000,000.00"); // Sri Lanka Currency - put("SEK", "SEK1,000,000.00"); // Sweden Currency - put("CHF", "CHF1,000,000.00"); // Switzerland Currency - put("THB", "THB1,000,000.00"); // Thailand Currency - put("TND", "TND1,000,000.000"); // Tunisia Currency - put("AED", "AED1,000,000.00"); // United Arab Emirates Currency - put("UGX", "UGX1,000,000"); // Uganda Currency + put("ALL", "L1,000,000.00"); // Albania Currency + put("ARS", "$1.000.000,00"); // Argentina Currency + put("AMD", "֏1,000,000.00"); // Armenia Currency + put("AUD", "A$1,000,000.00"); // Australia Currency + put("BDT", "Tk1,000,000.00"); // Bangladesh Currency + put("BRL", "R$1,000,000.00"); // Brazil Currency + put("BGN", "лв.1 000 000,00"); // Bulgaria Currency + put("KHR", "៛1,000,000.00"); // Cambodia Currency + put("CAD", "$1,000,000.00"); // Canada Currency + put("CLP", "$1.000.000"); // Chile Currency + put("CNY", "¥1,000,000.00"); // China Currency + put("COP", "$1.000.000,00"); // Colombia Currency + put("HRK", "kn1.000.000,00"); // Croatia Currency + put("CZK", "Kč1 000 000,00"); // Czech Republic Currency + put("DKK", "kr1,000,000.00"); // Denmark Currency + put("EGP", "E£1,000,000.00"); // Egypt Currency + put("EUR", "€1.000.000,00"); // Austria Currency + put("HKD", "HK$1,000,000.00"); // Hong Kong Currency + put("HUF", "Ft1 000 000,00"); // Hungary Currency + put("INR", "₹1,000,000.00"); // India Currency + put("IDR", "rp1,000,000"); // Indonesia Currency + put("JMD", "$1,000,000.00"); // Jamaica Currency + put("JPY", "¥1,000,000"); // Japan Currency + put("JOD", "د.ا1,000,000.00"); // Jordan Currency + put("KZT", "₸1 000 000,00"); // Kazakhstan Currency + put("KES", "KSh1,000,000.00"); // Kenya Currency + put("LAK", "₭1,000,000.00"); // Laos Currency + put("MYR", "RM1,000,000.00"); // Malaysia Currency + put("MXN", "$1,000,000.00"); // Mexico Currency + put("MAD", "د.م.1,000,000.00"); // Morocco Currency + put("ILS", "₪1,000,000.00"); // Israel Currency + put("TWD", "NT$1,000,000"); // Taiwan Currency + put("TRY", "TL1.000.000,00"); // Turkey Currency + put("NZD", "NZ$1,000,000.00"); // New Zealand Currency + put("NGN", "₦1,000,000.00"); // Nigeria Currency + put("NOK", "kr1 000 000,00"); // Norway Currency + put("PKR", "Rs1,000,000.00"); // Pakistan Currency + put("PEN", "S/.1,000,000.00"); // Peru Currency + put("PHP", "₱1,000,000.00"); // Philippines Currency + put("PLN", "zł1 000 000,00"); // Poland Currency + put("GBP", "£1,000,000.00"); // Isle of Man + put("RON", "lei1.000.000,00"); // Romania Currency + put("RUB", "руб1 000 000,00"); // Russia Currency + put("RSD", "Дин.1.000.000,00"); // Serbia Currency + put("SGD", "S$1,000,000.00"); // Singapore Currency + put("ZAR", "R1,000,000.00"); // South Africa Currency + put("KRW", "₩1,000,000"); // South Korea Currency + put("LKR", "රු1,000,000.00"); // Sri Lanka Currency + put("SEK", "kr1,000,000.00"); // Sweden Currency + put("CHF", "1,000,000.00"); // Switzerland Currency + put("THB", "฿1,000,000.00"); // Thailand Currency + put("TND", "د.ت1,000,000.000"); // Tunisia Currency + put("AED", "د.إ1,000,000.00"); // United Arab Emirates Currency + put("UGX", "USh1,000,000"); // Uganda Currency put("USD", "$1,000,000.00"); // United States Currency - put("VND", "VND1,000,000.00"); // Vietnam Currency + put("VND", "₫1.000.000,00"); // Vietnam Currency } }; @@ -85,7 +85,7 @@ public void testAllCurrencyFormats() { for (Map.Entry currencyMap : currenciesMap.entrySet()) { Context context = ApplicationProvider.getApplicationContext(); - String currency = CurrencyParser.getInstance(context).formatCurrency(currencyMap.getKey(), amount); + String currency = CurrencyParser.getInstance(context).formatCurrencyWithSymbol(currencyMap.getKey(), amount); assertThat(currency, is(currencyMap.getValue())); } } diff --git a/commonui/src/test/java/com/hyperwallet/android/ui/common/util/UtilsTest.java b/commonui/src/test/java/com/hyperwallet/android/ui/common/util/UtilsTest.java index a49604df7..62ff094e0 100644 --- a/commonui/src/test/java/com/hyperwallet/android/ui/common/util/UtilsTest.java +++ b/commonui/src/test/java/com/hyperwallet/android/ui/common/util/UtilsTest.java @@ -20,62 +20,62 @@ public class UtilsTest { private Map currenciesMap = new HashMap() { { - put("ALL", "ALL1,000,000.00"); // Albania Currency - put("ARS", "ARS1,000,000.00"); // Argentina Currency - put("AMD", "AMD1,000,000.00"); // Armenia Currency - put("AUD", "AUD1,000,000.00"); // Australia Currency - put("BDT", "BDT1,000,000.00"); // Bangladesh Currency - put("BRL", "BRL1,000,000.00"); // Brazil Currency - put("BGN", "BGN1,000,000.00"); // Bulgaria Currency - put("KHR", "KHR1,000,000.00"); // Cambodia Currency - put("CAD", "CAD1,000,000.00"); // Canada Currency - put("CLP", "CLP1,000,000"); // Chile Currency - put("CNY", "CNY1,000,000.00"); // China Currency - put("COP", "COP1,000,000.00"); // Colombia Currency - put("HRK", "HRK1,000,000.00"); // Croatia Currency - put("CZK", "CZK1,000,000.00"); // Czech Republic Currency - put("DKK", "DKK1,000,000.00"); // Denmark Currency - put("EGP", "EGP1,000,000.00"); // Egypt Currency - put("EUR", "EUR1,000,000.00"); // Austria Currency - put("HKD", "HKD1,000,000.00"); // Hong Kong Currency - put("HUF", "HUF1,000,000.00"); // Hungary Currency - put("INR", "INR1,000,000.00"); // India Currency - put("IDR", "IDR1,000,000"); // Indonesia Currency - put("JMD", "JMD1,000,000.00"); // Jamaica Currency - put("JPY", "JPY1,000,000"); // Japan Currency - put("JOD", "JOD1,000,000.00"); // Jordan Currency - put("KZT", "KZT1,000,000.00"); // Kazakhstan Currency - put("KES", "KES1,000,000.00"); // Kenya Currency - put("LAK", "LAK1,000,000.00"); // Laos Currency - put("MYR", "MYR1,000,000.00"); // Malaysia Currency - put("MXN", "MXN1,000,000.00"); // Mexico Currency - put("MAD", "MAD1,000,000.00"); // Morocco Currency - put("ILS", "ILS1,000,000.00"); // Israel Currency - put("TWD", "TWD1,000,000"); // Taiwan Currency - put("TRY", "TRY1,000,000.00"); // Turkey Currency - put("NZD", "NZD1,000,000.00"); // New Zealand Currency - put("NGN", "NGN1,000,000.00"); // Nigeria Currency - put("NOK", "NOK1,000,000.00"); // Norway Currency - put("PKR", "PKR1,000,000.00"); // Pakistan Currency - put("PEN", "PEN1,000,000.00"); // Peru Currency - put("PHP", "PHP1,000,000.00"); // Philippines Currency - put("PLN", "PLN1,000,000.00"); // Poland Currency - put("GBP", "GBP1,000,000.00"); // Isle of Man - put("RON", "RON1,000,000.00"); // Romania Currency - put("RUB", "RUB1,000,000.00"); // Russia Currency - put("RSD", "RSD1,000,000.00"); // Serbia Currency - put("SGD", "SGD1,000,000.00"); // Singapore Currency - put("ZAR", "ZAR1,000,000.00"); // South Africa Currency - put("KRW", "KRW1,000,000"); // South Korea Currency - put("LKR", "LKR1,000,000.00"); // Sri Lanka Currency - put("SEK", "SEK1,000,000.00"); // Sweden Currency - put("CHF", "CHF1,000,000.00"); // Switzerland Currency - put("THB", "THB1,000,000.00"); // Thailand Currency - put("TND", "TND1,000,000.000"); // Tunisia Currency - put("AED", "AED1,000,000.00"); // United Arab Emirates Currency - put("UGX", "UGX1,000,000"); // Uganda Currency + put("ALL", "L1,000,000.00"); // Albania Currency + put("ARS", "$1.000.000,00"); // Argentina Currency + put("AMD", "֏1,000,000.00"); // Armenia Currency + put("AUD", "A$1,000,000.00"); // Australia Currency + put("BDT", "Tk1,000,000.00"); // Bangladesh Currency + put("BRL", "R$1,000,000.00"); // Brazil Currency + put("BGN", "лв.1 000 000,00"); // Bulgaria Currency + put("KHR", "៛1,000,000.00"); // Cambodia Currency + put("CAD", "$1,000,000.00"); // Canada Currency + put("CLP", "$1.000.000"); // Chile Currency + put("CNY", "¥1,000,000.00"); // China Currency + put("COP", "$1.000.000,00"); // Colombia Currency + put("HRK", "kn1.000.000,00"); // Croatia Currency + put("CZK", "Kč1 000 000,00"); // Czech Republic Currency + put("DKK", "kr1,000,000.00"); // Denmark Currency + put("EGP", "E£1,000,000.00"); // Egypt Currency + put("EUR", "€1.000.000,00"); // Austria Currency + put("HKD", "HK$1,000,000.00"); // Hong Kong Currency + put("HUF", "Ft1 000 000,00"); // Hungary Currency + put("INR", "₹1,000,000.00"); // India Currency + put("IDR", "rp1,000,000"); // Indonesia Currency + put("JMD", "$1,000,000.00"); // Jamaica Currency + put("JPY", "¥1,000,000"); // Japan Currency + put("JOD", "د.ا1,000,000.00"); // Jordan Currency + put("KZT", "₸1 000 000,00"); // Kazakhstan Currency + put("KES", "KSh1,000,000.00"); // Kenya Currency + put("LAK", "₭1,000,000.00"); // Laos Currency + put("MYR", "RM1,000,000.00"); // Malaysia Currency + put("MXN", "$1,000,000.00"); // Mexico Currency + put("MAD", "د.م.1,000,000.00"); // Morocco Currency + put("ILS", "₪1,000,000.00"); // Israel Currency + put("TWD", "NT$1,000,000"); // Taiwan Currency + put("TRY", "TL1.000.000,00"); // Turkey Currency + put("NZD", "NZ$1,000,000.00"); // New Zealand Currency + put("NGN", "₦1,000,000.00"); // Nigeria Currency + put("NOK", "kr1 000 000,00"); // Norway Currency + put("PKR", "Rs1,000,000.00"); // Pakistan Currency + put("PEN", "S/.1,000,000.00"); // Peru Currency + put("PHP", "₱1,000,000.00"); // Philippines Currency + put("PLN", "zł1 000 000,00"); // Poland Currency + put("GBP", "£1,000,000.00"); // Isle of Man + put("RON", "lei1.000.000,00"); // Romania Currency + put("RUB", "руб1 000 000,00"); // Russia Currency + put("RSD", "Дин.1.000.000,00"); // Serbia Currency + put("SGD", "S$1,000,000.00"); // Singapore Currency + put("ZAR", "R1,000,000.00"); // South Africa Currency + put("KRW", "₩1,000,000"); // South Korea Currency + put("LKR", "රු1,000,000.00"); // Sri Lanka Currency + put("SEK", "kr1,000,000.00"); // Sweden Currency + put("CHF", "1,000,000.00"); // Switzerland Currency + put("THB", "฿1,000,000.00"); // Thailand Currency + put("TND", "د.ت1,000,000.000"); // Tunisia Currency + put("AED", "د.إ1,000,000.00"); // United Arab Emirates Currency + put("UGX", "USh1,000,000"); // Uganda Currency put("USD", "$1,000,000.00"); // United States Currency - put("VND", "VND1,000,000.00"); // Vietnam Currency + put("VND", "₫1.000.000,00"); // Vietnam Currency } }; @@ -85,7 +85,7 @@ public void testAllCurrencyFormats() { for (Map.Entry currencyMap : currenciesMap.entrySet()) { Context context = ApplicationProvider.getApplicationContext(); - String currency = CurrencyParser.getInstance(context).formatCurrency(currencyMap.getKey(), amount); + String currency = CurrencyParser.getInstance(context).formatCurrencyWithSymbol(currencyMap.getKey(), amount); assertThat(currency, is(currencyMap.getValue())); } } diff --git a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListPrepaidCardReceiptsTest.java b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListPrepaidCardReceiptsTest.java index 821ce0a7d..b983784ff 100644 --- a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListPrepaidCardReceiptsTest.java +++ b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListPrepaidCardReceiptsTest.java @@ -77,7 +77,7 @@ protected Intent getActivityIntent() { private TimeZone mDefaultTimeZone; private String usdCurrencySymbol = "$"; - private String cadCurrencySymbol = "CA$"; + private String cadCurrencySymbol = "$"; private String wonCurrencySymbol = "₩"; private String debitSymbol = "-"; private String monthLabel1 = "June 2019"; @@ -317,7 +317,7 @@ public void testListPrepaidCardReceipt_checkDateTextOnLocaleChange() { matches(atPosition(0, hasDescendant(withText(R.string.adjustment))))); onView(withId(R.id.list_receipts)).check( - matches(atPosition(0, hasDescendant(withText(containsString(debitSymbol + "8,90")))))); + matches(atPosition(0, hasDescendant(withText(containsString(debitSymbol + usdCurrencySymbol +"8.90")))))); onView(withId(R.id.list_receipts)).check( matches(atPosition(0, hasDescendant(withText("1. Juni 2019"))))); onView(withId(R.id.list_receipts)).check( diff --git a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListUserReceiptsTest.java b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListUserReceiptsTest.java index b5e54f048..3717d2e69 100644 --- a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListUserReceiptsTest.java +++ b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/ListUserReceiptsTest.java @@ -69,17 +69,17 @@ public class ListUserReceiptsTest { private TimeZone mDefaultTimeZone; private String usdCurrencySymbol = "$"; - private String cadCurrencySymbol = "CA$"; + private String cadCurrencySymbol = "$"; private String krwCurrencySymbol = "₩"; private String debitSymbol = "-"; private String monthLabel1 = "June 2019"; private String monthLabel2 = "December 2018"; - Pair CAD = new Pair("CAD","CA$"); + Pair CAD = new Pair("CAD","$"); Pair USD = new Pair("USD","$"); - Pair EURO = new Pair("EUR", "€"); - Pair KRW = new Pair("KRW", "₩"); - Pair JOD = new Pair("JOD", "JOD"); + Pair EURO = new Pair("EUR","€"); + Pair KRW = new Pair("KRW","₩"); + Pair JOD = new Pair("JOD","د.ا"); @Before public void setup() { @@ -214,7 +214,7 @@ public void testListReceipt_userHasMultipleTransactionCurrencyFormat() { onView(withId(R.id.list_receipts)).check( matches(atPosition(3, hasDescendant(withText(R.string.transfer_to_prepaid_card))))); onView(withId(R.id.list_receipts)).check( - matches(atPosition(3, hasDescendant(withText(debitSymbol + EURO.second.toString() + "10,000,000.00"))))); + matches(atPosition(3, hasDescendant(withText(debitSymbol + EURO.second.toString() + "10.000.000,00 "))))); onView(withId(R.id.list_receipts)).check( matches(atPosition(3, hasDescendant(withText("December 1, 2018"))))); onView(withId(R.id.list_receipts)).check(matches(atPosition(3, hasDescendant(withText(EURO.first.toString()))))); diff --git a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/TabbedListReceiptsTest.java b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/TabbedListReceiptsTest.java index 6f29e55b5..80765d3fe 100644 --- a/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/TabbedListReceiptsTest.java +++ b/receiptui/src/androidTest/java/com/hyperwallet/android/ui/receipt/TabbedListReceiptsTest.java @@ -89,7 +89,7 @@ protected Intent getActivityIntent() { private TimeZone mDefaultTimeZone; private String monthLabel1 = "June 2019"; - private String cadCurrencySymbol = "CA$"; + private String cadCurrencySymbol = "$"; private String usdCurrencySymbol = "$"; private String debitSymbol = "-"; Pair KRW = new Pair("KRW", "₩"); diff --git a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptFragment.java b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptFragment.java index 237640deb..385150ebc 100644 --- a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptFragment.java +++ b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptFragment.java @@ -287,7 +287,7 @@ public void onOneClick(View v) { transactionAmount.setTextColor(transactionAmount.getContext() .getResources().getColor(R.color.positiveColor)); transactionAmount.setText( - CurrencyParser.getInstance(itemView.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(itemView.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount())); transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.positiveColor)); @@ -298,7 +298,7 @@ public void onOneClick(View v) { transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.negativeColor)); transactionAmount.setText(transactionAmount.getContext().getString(R.string.debit_sign, - CurrencyParser.getInstance(itemView.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(itemView.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount()))); transactionTypeIcon.setText(transactionTypeIcon.getContext().getText(R.string.debit)); } diff --git a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptsFragment.java b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptsFragment.java index 548512e05..f66ee74b2 100644 --- a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptsFragment.java +++ b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ListReceiptsFragment.java @@ -323,7 +323,7 @@ public void onOneClick(View v) { transactionAmount.setTextColor(transactionAmount.getContext() .getResources().getColor(R.color.positiveColor)); transactionAmount.setText( - CurrencyParser.getInstance(itemView.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(itemView.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount())); transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.positiveColor)); @@ -334,7 +334,7 @@ public void onOneClick(View v) { transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.negativeColor)); transactionAmount.setText(transactionAmount.getContext().getString(R.string.debit_sign, - CurrencyParser.getInstance(itemView.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(itemView.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount()))); transactionTypeIcon.setText(transactionTypeIcon.getContext().getText(R.string.debit)); } diff --git a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ReceiptDetailFragment.java b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ReceiptDetailFragment.java index 70025ac55..16c0163a1 100644 --- a/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ReceiptDetailFragment.java +++ b/receiptui/src/main/java/com/hyperwallet/android/ui/receipt/view/ReceiptDetailFragment.java @@ -136,7 +136,7 @@ private void setTransactionView(@NonNull final Receipt receipt, @NonNull final V transactionAmount.setTextColor(transactionAmount.getContext() .getResources().getColor(R.color.positiveColor)); transactionAmount.setText( - CurrencyParser.getInstance(view.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(view.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount())); transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.positiveColor)); @@ -145,7 +145,7 @@ private void setTransactionView(@NonNull final Receipt receipt, @NonNull final V transactionAmount.setTextColor(transactionAmount.getContext() .getResources().getColor(R.color.negativeColor)); transactionAmount.setText(transactionAmount.getContext().getString(R.string.debit_sign, - CurrencyParser.getInstance(view.getContext()).formatCurrency(receipt.getCurrency(), + CurrencyParser.getInstance(view.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount()))); transactionTypeIcon.setTextColor(transactionTypeIcon.getContext() .getResources().getColor(R.color.negativeColor)); @@ -180,15 +180,15 @@ private void setFeeDetailsView(@NonNull final Receipt receipt, @NonNull final Vi String currencySymbol = Currency.getInstance(receipt.getCurrency()).getSymbol(Locale.getDefault()); TextView amountView = view.findViewById(R.id.details_amount_value); - amountView.setText(CurrencyParser.getInstance(view.getContext()).formatCurrency(receipt.getCurrency(), + amountView.setText(CurrencyParser.getInstance(view.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getAmount()) + " " + receipt.getCurrency()); TextView fee = view.findViewById(R.id.details_fee_value); - fee.setText(CurrencyParser.getInstance(view.getContext()).formatCurrency(receipt.getCurrency(), + fee.setText(CurrencyParser.getInstance(view.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), receipt.getFee()) + " " + receipt.getCurrency()); TextView transfer = view.findViewById(R.id.details_transfer_amount_value); - transfer.setText(CurrencyParser.getInstance(view.getContext()).formatCurrency(receipt.getCurrency(), + transfer.setText(CurrencyParser.getInstance(view.getContext()).formatCurrencyWithSymbol(receipt.getCurrency(), transferAmountTotal) + " " + receipt.getCurrency()); } } diff --git a/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferPPCFundsTest.java b/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferPPCFundsTest.java index f2fd9eb7c..068050206 100644 --- a/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferPPCFundsTest.java +++ b/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferPPCFundsTest.java @@ -293,7 +293,7 @@ public void onReceive(Context context, Intent intent) { allOf(withId(R.id.exchange_rate_label), withText(R.string.mobileFXRateLabel)))))); onView(withId(R.id.list_foreign_exchange)).check( matches(atPosition(0, - hasDescendant(allOf(withId(R.id.exchange_rate_value), withText("$1 USD = $1.2912 CAD")))))); + hasDescendant(allOf(withId(R.id.exchange_rate_value), withText("$1 USD = $1.2913 CAD")))))); onView(withId(R.id.amount_label)).check(matches(withText(R.string.mobileConfirmDetailsAmount))); onView(withId(R.id.amount_value)).check(matches(withText("$152.20 CAD"))); onView(withId(R.id.fee_label)).check(matches(withText(R.string.mobileConfirmDetailsFee))); diff --git a/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferUserFundsTest.java b/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferUserFundsTest.java index e4cafd035..3fc4dd985 100644 --- a/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferUserFundsTest.java +++ b/transferui/src/androidTest/java/com/hyperwallet/android/ui/transfer/TransferUserFundsTest.java @@ -812,7 +812,7 @@ public void onReceive(Context context, Intent intent) { matches(atPosition(1, hasDescendant( allOf(withId(R.id.sell_label), withText(R.string.mobileFXsell)))))); onView(withId(R.id.list_foreign_exchange)).check( - matches(atPosition(1, hasDescendant(allOf(withId(R.id.sell_value), withText("€100.00 EUR")))))); + matches(atPosition(1, hasDescendant(allOf(withId(R.id.sell_value), withText("€100,00  EUR")))))); onView(withId(R.id.list_foreign_exchange)).check( matches(atPosition(1, hasDescendant(allOf(withId(R.id.buy_label), withText(R.string.mobileFXbuy)))))); @@ -925,7 +925,7 @@ public void onReceive(Context context, Intent intent) { matches(atPosition(1, hasDescendant( allOf(withId(R.id.sell_label), withText(R.string.mobileFXsell)))))); onView(withId(R.id.list_foreign_exchange)).check( - matches(atPosition(1, hasDescendant(allOf(withId(R.id.sell_value), withText("€100.00 EUR")))))); + matches(atPosition(1, hasDescendant(allOf(withId(R.id.sell_value), withText("€100,00  EUR")))))); onView(withId(R.id.list_foreign_exchange)).check( matches(atPosition(1, hasDescendant(allOf(withId(R.id.buy_label), withText(R.string.mobileFXbuy)))))); diff --git a/transferui/src/main/assets/currency.json b/transferui/src/main/assets/currency.json deleted file mode 100644 index bdb496f0a..000000000 --- a/transferui/src/main/assets/currency.json +++ /dev/null @@ -1,1474 +0,0 @@ -[ - { - "id" : 23, - "name" : "United Arab Emirates Dirham", - "currencycode" : "AED", - "isocurrencycode" : "784", - "baseunit" : "dirham", - "denominationamount" : 200, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "د.إ", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 85, - "name" : "Albanian LEK", - "currencycode" : "ALL", - "isocurrencycode" : "008", - "baseunit" : "qindarka", - "denominationamount" : 5550, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "L", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 93, - "name" : "Armenian Dram", - "currencycode" : "AMD", - "isocurrencycode" : "051", - "baseunit" : "luma", - "denominationamount" : 23000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "֏", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 86, - "name" : "Argentine Peso", - "currencycode" : "ARS", - "isocurrencycode" : "032", - "baseunit" : "centavo", - "denominationamount" : 3000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 1, - "name" : "Australian Dollar", - "currencycode" : "AUD", - "isocurrencycode" : "036", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "A$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 79, - "name" : "Australian Dollar", - "currencycode" : "BAM", - "isocurrencycode" : "036", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "A$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 39, - "name" : "Bangladeshi Taka", - "currencycode" : "BDT", - "isocurrencycode" : "050", - "baseunit" : "poisha", - "denominationamount" : 4000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Tk", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 41, - "name" : "Bulgarian Lev", - "currencycode" : "BGN", - "isocurrencycode" : "975", - "baseunit" : "stotinka", - "denominationamount" : 90, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "лв.", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 42, - "name" : "Bahraini Dinar", - "currencycode" : "BHD", - "isocurrencycode" : "48", - "baseunit" : "fils", - "denominationamount" : 190, - "decimals" : 3, - "hiddenDecimals" : 0, - "symbol" : ".د.ب", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 87, - "name" : "Bolivian Boliviano", - "currencycode" : "BOB", - "isocurrencycode" : "068", - "baseunit" : "centavos", - "denominationamount" : 350, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Bs", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 16, - "name" : "Real", - "currencycode" : "BRL", - "isocurrencycode" : "076", - "baseunit" : "real", - "denominationamount" : 200, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "R$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 43, - "name" : "Botswana Pula", - "currencycode" : "BWP", - "isocurrencycode" : "72", - "baseunit" : "thebe", - "denominationamount" : 550, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "P", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 26, - "name" : "Pay Points", - "currencycode" : "C01", - "isocurrencycode" : "C01", - "baseunit" : "point", - "denominationamount" : 1, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "PLP", - "exchangeable" : 1, - "governmentissued" : 0, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 28, - "name" : "MonaVie Credits", - "currencycode" : "C02", - "isocurrencycode" : "C02", - "baseunit" : "point", - "denominationamount" : 1, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "MVC", - "exchangeable" : 1, - "governmentissued" : 0, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 36, - "name" : "USD", - "currencycode" : "C03", - "isocurrencycode" : "C03", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 0, - "groupingUsed" : 1, - "fxTransactionVisible" : 0, - "displayedAs" : "USD" - }, - { - "id" : 2, - "name" : "Canadian Dollar", - "currencycode" : "CAD", - "isocurrencycode" : "124", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 45, - "name" : "Swiss Franc", - "currencycode" : "CHF", - "isocurrencycode" : "756", - "baseunit" : "centimes", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 33, - "name" : "Peso", - "currencycode" : "CLP", - "isocurrencycode" : "152", - "baseunit" : "centavos", - "denominationamount" : 365, - "decimals" : 0, - "hiddenDecimals" : 2, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 75, - "name" : "Chinese Renminbi Offshore HK", - "currencycode" : "CNH", - "isocurrencycode" : "", - "baseunit" : "", - "denominationamount" : 352, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "¥", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 3, - "name" : "Yuan Renminbi", - "currencycode" : "CNY", - "isocurrencycode" : "156", - "baseunit" : "", - "denominationamount" : 351, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "¥", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 35, - "name" : "Colombian Peso", - "currencycode" : "COP", - "isocurrencycode" : "170", - "baseunit" : "centavo", - "denominationamount" : 170000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 46, - "name" : "Czech Koruna", - "currencycode" : "CZK", - "isocurrencycode" : "203", - "baseunit" : "haléřů", - "denominationamount" : 1000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Kč", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 47, - "name" : "Danish Kroner", - "currencycode" : "DKK", - "isocurrencycode" : "208", - "baseunit" : "øre", - "denominationamount" : 335, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "kr", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 37, - "name" : "Estonian kroon", - "currencycode" : "EEK", - "isocurrencycode" : "233", - "baseunit" : "sent", - "denominationamount" : 700, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "KR", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 91, - "name" : "Egyptian pound", - "currencycode" : "EGP", - "isocurrencycode" : "818", - "baseunit" : "piastre", - "denominationamount" : 800, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "E£", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 40, - "name" : "Ethiopian Birr", - "currencycode" : "ETB", - "isocurrencycode" : "251", - "baseunit" : "santim", - "denominationamount" : 1500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Br", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 4, - "name" : "Euro", - "currencycode" : "EUR", - "isocurrencycode" : "978", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "€", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 48, - "name" : "Fiji Dollar", - "currencycode" : "FJD", - "isocurrencycode" : "242", - "baseunit" : "cents", - "denominationamount" : 100, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "FJ$", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 5, - "name" : "Pound", - "currencycode" : "GBP", - "isocurrencycode" : "826", - "baseunit" : "pence", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "£", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 49, - "name" : "Ghanaian Cedi", - "currencycode" : "GHS", - "isocurrencycode" : "936", - "baseunit" : "pesewas ", - "denominationamount" : 275, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "GH₵", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 50, - "name" : "Gambian Dalasi", - "currencycode" : "GMD", - "isocurrencycode" : "270", - "baseunit" : "bututs", - "denominationamount" : 2500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "D", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 6, - "name" : "Hong Kong Dollar", - "currencycode" : "HKD", - "isocurrencycode" : "344", - "baseunit" : "cents", - "denominationamount" : 400, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "HK$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 78, - "name" : "Croatian Kuna", - "currencycode" : "HRK", - "isocurrencycode" : "191", - "baseunit" : "Lipa", - "denominationamount" : 335, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "kn", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 27, - "name" : "Hungary Forint", - "currencycode" : "HUF", - "isocurrencycode" : "348", - "baseunit" : "filler", - "denominationamount" : 15000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Ft", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 29, - "name" : "Indonesian rupiah", - "currencycode" : "IDR", - "isocurrencycode" : "360", - "baseunit" : "rupiah", - "denominationamount" : 7044, - "decimals" : 0, - "hiddenDecimals" : 2, - "symbol" : "rp", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 18, - "name" : "New Israeli Shekel", - "currencycode" : "ILS", - "isocurrencycode" : "376", - "baseunit" : "agorot", - "denominationamount" : 175, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₪", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 12, - "name" : "Indian Rupee", - "currencycode" : "INR", - "isocurrencycode" : "356", - "baseunit" : "paise", - "denominationamount" : 3550, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₹", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 51, - "name" : "Icelandic Krona", - "currencycode" : "ISK", - "isocurrencycode" : "352", - "baseunit" : "", - "denominationamount" : 61, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "Íkr", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 90, - "name" : "Jamaican Dollar", - "currencycode" : "JMD", - "isocurrencycode" : "388", - "baseunit" : "cents", - "denominationamount" : 6500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 52, - "name" : "Jordanian Dinar", - "currencycode" : "JOD", - "isocurrencycode" : "400", - "baseunit" : "qirsh", - "denominationamount" : 35, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "د.ا", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 15, - "name" : "Japanese Yen", - "currencycode" : "JPY", - "isocurrencycode" : "392", - "baseunit" : "yen", - "denominationamount" : 54, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "¥", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 20, - "name" : "Kenyan Shilling", - "currencycode" : "KES", - "isocurrencycode" : "404", - "baseunit" : "cents", - "denominationamount" : 5000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "KSh", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 84, - "name" : "Cambodian Riel", - "currencycode" : "KHR", - "isocurrencycode" : "116", - "baseunit" : "sen", - "denominationamount" : 200000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "៛", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 21, - "name" : "South Korean Won", - "currencycode" : "KRW", - "isocurrencycode" : "410", - "baseunit" : "jeon", - "denominationamount" : 588, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "₩", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 53, - "name" : "Kuwaiti Dinar", - "currencycode" : "KWD", - "isocurrencycode" : "414", - "baseunit" : "fils", - "denominationamount" : 15, - "decimals" : 3, - "hiddenDecimals" : 0, - "symbol" : "د.ك", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 92, - "name" : "Kazakhstani tenge", - "currencycode" : "KZT", - "isocurrencycode" : "398", - "baseunit" : "Tiyn", - "denominationamount" : 19500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₸", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 83, - "name" : "Laos KIP", - "currencycode" : "LAK", - "isocurrencycode" : "418", - "baseunit" : "att", - "denominationamount" : 440000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₭", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 80, - "name" : "Sri Lankan Rupee", - "currencycode" : "LKR", - "isocurrencycode" : "144", - "baseunit" : "Cents", - "denominationamount" : 9000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "රු", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 54, - "name" : "Lesotho Maloti", - "currencycode" : "LSL", - "isocurrencycode" : "426", - "baseunit" : "lisente", - "denominationamount" : 700, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "M", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 55, - "name" : "Moroccan Dirham", - "currencycode" : "MAD", - "isocurrencycode" : "504", - "baseunit" : "Santim", - "denominationamount" : 475, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "د.م.", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 56, - "name" : "Malagasy Ariary", - "currencycode" : "MGA", - "isocurrencycode" : "969", - "baseunit" : "", - "denominationamount" : 1840, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "Ar", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 95, - "name" : "Mauritanian Ouguiya", - "currencycode" : "MRU", - "isocurrencycode" : "929", - "baseunit" : "khoums", - "denominationamount" : 1850, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "UM", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 57, - "name" : "Mauritian Rupee", - "currencycode" : "MUR", - "isocurrencycode" : "480", - "baseunit" : "cents", - "denominationamount" : 1825, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Rs", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 58, - "name" : "Malawian Kwacha", - "currencycode" : "MWK", - "isocurrencycode" : "454", - "baseunit" : "tambala", - "denominationamount" : 36500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "MK", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 14, - "name" : "Mexican Peso", - "currencycode" : "MXN", - "isocurrencycode" : "484", - "baseunit" : "centavos", - "denominationamount" : 1000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 7, - "name" : "Malaysian Ringgit", - "currencycode" : "MYR", - "isocurrencycode" : "458", - "baseunit" : "sen", - "denominationamount" : 200, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "RM", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 59, - "name" : "Mozambican New Metical", - "currencycode" : "MZN", - "isocurrencycode" : "943", - "baseunit" : "centavos", - "denominationamount" : 3100, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "MTn", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 60, - "name" : "Namibian Dollar", - "currencycode" : "NAD", - "isocurrencycode" : "516", - "baseunit" : "cents", - "denominationamount" : 725, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "N$", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 34, - "name" : "Naira", - "currencycode" : "NGN", - "isocurrencycode" : "566", - "baseunit" : "naira", - "denominationamount" : 18000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₦", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 30, - "name" : "Norwegian Krone", - "currencycode" : "NOK", - "isocurrencycode" : "578", - "baseunit" : "øre", - "denominationamount" : 450, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "kr", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 82, - "name" : "Nepalese Rupee", - "currencycode" : "NPR", - "isocurrencycode" : "524", - "baseunit" : "Paisa", - "denominationamount" : 5500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "रू", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 8, - "name" : "New Zealand Dollar", - "currencycode" : "NZD", - "isocurrencycode" : "554", - "baseunit" : "cents", - "denominationamount" : 75, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "NZ$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 61, - "name" : "Omani Rial", - "currencycode" : "OMR", - "isocurrencycode" : "512", - "baseunit" : "baisa ", - "denominationamount" : 190, - "decimals" : 3, - "hiddenDecimals" : 0, - "symbol" : "ر.ع.", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 32, - "name" : "Nuevo sol", - "currencycode" : "PEN", - "isocurrencycode" : "604", - "baseunit" : "nuevo sol", - "denominationamount" : 165, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "S/.", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 62, - "name" : "Papua New Guinean Kina", - "currencycode" : "PGK", - "isocurrencycode" : "598", - "baseunit" : "toea", - "denominationamount" : 170, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "K", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 17, - "name" : "Philippines Pesos", - "currencycode" : "PHP", - "isocurrencycode" : "608", - "baseunit" : "pesos", - "denominationamount" : 2500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₱", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 81, - "name" : "Pakistani Rupee", - "currencycode" : "PKR", - "isocurrencycode" : "586", - "baseunit" : "Paisa", - "denominationamount" : 7500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Rs", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 19, - "name" : "Polish Zloty", - "currencycode" : "PLN", - "isocurrencycode" : "985", - "baseunit" : "grosz", - "denominationamount" : 200, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "zł", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 63, - "name" : "Qatari Riyal", - "currencycode" : "QAR", - "isocurrencycode" : "634", - "baseunit" : "dirham", - "denominationamount" : 185, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "ر.ق", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 77, - "name" : "Romanian Leu", - "currencycode" : "RON", - "isocurrencycode" : "946", - "baseunit" : "bani", - "denominationamount" : 215, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "lei", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 89, - "name" : "Serbian dinar", - "currencycode" : "RSD", - "isocurrencycode" : "941", - "baseunit" : "para", - "denominationamount" : 5000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "Дин.", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 22, - "name" : "Russian Ruble", - "currencycode" : "RUB", - "isocurrencycode" : "643", - "baseunit" : "rub", - "denominationamount" : 3000, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "руб", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 64, - "name" : "Solomon Islands Dollar", - "currencycode" : "SBD", - "isocurrencycode" : "90", - "baseunit" : "cents", - "denominationamount" : 400, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "SI$", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 65, - "name" : "Swedish Kronor", - "currencycode" : "SEK", - "isocurrencycode" : "752", - "baseunit" : "öre", - "denominationamount" : 475, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "kr", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 9, - "name" : "Singapore Dollar", - "currencycode" : "SGD", - "isocurrencycode" : "702", - "baseunit" : "cent", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "S$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 94, - "name" : "Salvadoran colón", - "currencycode" : "SVC", - "isocurrencycode" : "222", - "baseunit" : "cents", - "denominationamount" : 435, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₡", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 66, - "name" : "Swazi Lilangeni", - "currencycode" : "SZL", - "isocurrencycode" : "748", - "baseunit" : "cents", - "denominationamount" : 730, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "E", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 25, - "name" : "Thailand Baht", - "currencycode" : "THB", - "isocurrencycode" : "764", - "baseunit" : "baht", - "denominationamount" : 1500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "฿", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 67, - "name" : "Tunisian Dinar", - "currencycode" : "TND", - "isocurrencycode" : "788", - "baseunit" : "millimes ", - "denominationamount" : 1420, - "decimals" : 3, - "hiddenDecimals" : 0, - "symbol" : "د.ت", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 68, - "name" : "Tongan Pa'anga", - "currencycode" : "TOP", - "isocurrencycode" : "776", - "baseunit" : "seniti", - "denominationamount" : 115, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "T$", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 24, - "name" : "Turkish Lira", - "currencycode" : "TRY", - "isocurrencycode" : "949", - "baseunit" : "lira", - "denominationamount" : 285, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "TL", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 10, - "name" : "New Taiwan Dollar", - "currencycode" : "TWD", - "isocurrencycode" : "901", - "baseunit" : "cents", - "denominationamount" : 15, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "NT$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 69, - "name" : "Ugandan Shilling", - "currencycode" : "UGX", - "isocurrencycode" : "800", - "baseunit" : "", - "denominationamount" : 1843, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "USh", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 11, - "name" : "United States Dollar", - "currencycode" : "USD", - "isocurrencycode" : "840", - "baseunit" : "cents", - "denominationamount" : 50, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 88, - "name" : "Uruguayan Peso", - "currencycode" : "UYU", - "isocurrencycode" : "858", - "baseunit" : "centésimos", - "denominationamount" : 1875, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 31, - "name" : "Vietnamese Dong", - "currencycode" : "VND", - "isocurrencycode" : "704", - "baseunit" : "xu", - "denominationamount" : 1157500, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "₫", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 70, - "name" : "Vanuatu Vatu", - "currencycode" : "VUV", - "isocurrencycode" : "548", - "baseunit" : "", - "denominationamount" : 58, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "VT", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 71, - "name" : "Samoan Tālā", - "currencycode" : "WST", - "isocurrencycode" : "882", - "baseunit" : "sene", - "denominationamount" : 135, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "T", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 72, - "name" : "CFP Franc", - "currencycode" : "XPF", - "isocurrencycode" : "953", - "baseunit" : "centimes", - "denominationamount" : 5400, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "F", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 13, - "name" : "Rand", - "currencycode" : "ZAR", - "isocurrencycode" : "710", - "baseunit" : "cents", - "denominationamount" : 725, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "R", - "exchangeable" : 1, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 73, - "name" : "Zambian Kwacha", - "currencycode" : "ZMW", - "isocurrencycode" : "967", - "baseunit" : "ngwee", - "denominationamount" : 665, - "decimals" : 2, - "hiddenDecimals" : 0, - "symbol" : "ZMK", - "exchangeable" : 0, - "governmentissued" : 1, - "groupingUsed" : 1, - "fxTransactionVisible" : 1, - "displayedAs" : null - }, - { - "id" : 76, - "name" : "Other", - "currencycode" : "_O", - "isocurrencycode" : "_O", - "baseunit" : "", - "denominationamount" : 1, - "decimals" : 0, - "hiddenDecimals" : 0, - "symbol" : "$", - "exchangeable" : 0, - "governmentissued" : 0, - "groupingUsed" : 0, - "fxTransactionVisible" : 0, - "displayedAs" : "ANY" - } -] diff --git a/transferui/src/main/java/com/hyperwallet/android/ui/transfer/CurrencyDetails.java b/transferui/src/main/java/com/hyperwallet/android/ui/transfer/CurrencyDetails.java deleted file mode 100644 index 74ccb1a0e..000000000 --- a/transferui/src/main/java/com/hyperwallet/android/ui/transfer/CurrencyDetails.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.hyperwallet.android.ui.transfer; - - -public class CurrencyDetails { - - private Integer id; - private String name; - private String currencyCode; - private String isoCurrencyCode; - private String baseUnit; - private Integer denominationAmount; - private Integer decimals; - private Integer hiddenDecimals; - private Integer exchangeable; - private Integer governmentIssued; - private Integer groupingUsed; - private Integer fxTransactionVisible; - private String displayedAs; - private String symbol; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCurrencyCode() { - return currencyCode; - } - - public void setCurrencyCode(String currencyCode) { - this.currencyCode = currencyCode; - } - - public String getIsoCurrencyCode() { - return isoCurrencyCode; - } - - public void setIsoCurrencyCode(String isoCurrencyCode) { - this.isoCurrencyCode = isoCurrencyCode; - } - - public String getBaseUnit() { - return baseUnit; - } - - public void setBaseUnit(String baseUnit) { - this.baseUnit = baseUnit; - } - - public Integer getDenominationAmount() { - return denominationAmount; - } - - public void setDenominationAmount(Integer denominationAmount) { - this.denominationAmount = denominationAmount; - } - - public Integer getDecimals() { - return decimals; - } - - public void setDecimals(Integer decimals) { - this.decimals = decimals; - } - - public Integer getHiddenDecimals() { - return hiddenDecimals; - } - - public void setHiddenDecimals(Integer hiddenDecimals) { - this.hiddenDecimals = hiddenDecimals; - } - - public String getSymbol() { - return symbol; - } - - public void setSymbol(String symbol) { - this.symbol = symbol; - } - - public Integer getExchangeable() { - return exchangeable; - } - - public void setExchangeable(Integer exchangeable) { - this.exchangeable = exchangeable; - } - - public Integer getGovernmentIssued() { - return governmentIssued; - } - - public void setGovernmentIssued(Integer governmentIssued) { - this.governmentIssued = governmentIssued; - } - - public Integer getGroupingUsed() { - return groupingUsed; - } - - public void setGroupingUsed(Integer groupingUsed) { - this.groupingUsed = groupingUsed; - } - - public Integer getFxTransactionVisible() { - return fxTransactionVisible; - } - - public void setFxTransactionVisible(Integer fxTransactionVisible) { - this.fxTransactionVisible = fxTransactionVisible; - } - - public String getDisplayedAs() { - return displayedAs; - } - - public void setDisplayedAs(String displayedAs) { - this.displayedAs = displayedAs; - } -} diff --git a/transferui/src/main/java/com/hyperwallet/android/ui/transfer/view/CreateTransferFragment.java b/transferui/src/main/java/com/hyperwallet/android/ui/transfer/view/CreateTransferFragment.java index 8bbd80e8b..65ba69e7c 100644 --- a/transferui/src/main/java/com/hyperwallet/android/ui/transfer/view/CreateTransferFragment.java +++ b/transferui/src/main/java/com/hyperwallet/android/ui/transfer/view/CreateTransferFragment.java @@ -60,8 +60,10 @@ import com.hyperwallet.android.model.transfermethod.TransferMethod; import com.hyperwallet.android.ui.common.intent.HyperwalletIntent; import com.hyperwallet.android.ui.common.repository.Event; +import com.hyperwallet.android.ui.common.util.CurrencyDetails; +import com.hyperwallet.android.ui.common.util.CurrencyParser; +import com.hyperwallet.android.ui.common.util.LocaleDetails; import com.hyperwallet.android.ui.common.view.OneClickListener; -import com.hyperwallet.android.ui.transfer.CurrencyDetails; import com.hyperwallet.android.ui.transfer.R; import com.hyperwallet.android.ui.transfer.TransferSource; import com.hyperwallet.android.ui.transfer.viewmodel.CreateTransferViewModel; @@ -76,6 +78,7 @@ import java.text.DecimalFormatSymbols; import java.util.ArrayList; import java.util.Currency; +import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -544,9 +547,18 @@ public void onChanged(final TransferMethod transferMethod) { CurrencyDetails currencyDetails = getNumberOfFractionDigits(mCurrencyCode); mNumberOfFractionDigits = currencyDetails == null ? 0 : currencyDetails.getDecimals(); mTransferCurrencyCode.setText(currencyDetails == null ? "" : currencyDetails.getSymbol()); - mTransferAmount.setText( - formattedAmount(stringToDouble(mTransferAmount.getText().toString()), - mCurrencyCode)); + if (mDecimalSeparator != null && mGroupSeparator != null) { + mTransferAmount.setText( + formattedAmount(stringToDouble( + mTransferAmount.getText().toString().replace(mGroupSeparator, + EMPTY_STRING).replace(mDecimalSeparator, + CURRENCY_DOT_SEPARATOR)), + mCurrencyCode)); + } else { + mTransferAmount.setText( + formattedAmount(stringToDouble(mTransferAmount.getText().toString()), + mCurrencyCode)); + } showTransferDestination(transferMethod); enableInputControls(); } else { @@ -766,7 +778,14 @@ private void showTransferSource(@NonNull final TransferSource transferSource) { } private String formattedAmount(final double amount, final String currencyCode) { - DecimalFormat currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance(); + HashMap localeList = CurrencyParser.getInstance(requireContext()).getLocaleList(); + DecimalFormat currencyFormatter; + if(localeList.containsKey(currencyCode)) { + LocaleDetails locale = localeList.get(currencyCode); + currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance((new Locale(locale.getLanguage(),locale.getCountryCode()))); + }else { + currencyFormatter = (DecimalFormat) DecimalFormat.getCurrencyInstance(); + } if (mNumberOfFractionDigits < 3) { currencyFormatter.setMaximumFractionDigits(mNumberOfFractionDigits); } else {