@Test public void testAllISOCurrenciesIncluded() { Set<java.util.Currency> currencies = java.util.Currency.getAvailableCurrencies(); StringBuilder msg = new StringBuilder(); for (java.util.Currency sc : currencies) { try { if (sc.getDefaultFractionDigits() < 0) continue; int currencyCode = sc.getNumericCode(); Currency currencyByCode = ISOCurrency.getCurrency(currencyCode); assertEquals(sc.getDefaultFractionDigits(), currencyByCode.getDecimals(), "jPOS currency does not match decimals"); } catch (Throwable ignored) { msg.append(sc.getCurrencyCode().toUpperCase() + "=" + ISOUtil.zeropad(sc.getNumericCode(), 3) + " " + sc.getDefaultFractionDigits() + " } } assertEquals(msg.length(), 0, msg.toString()); }
public static Currency getCurrency(int code) throws ISOException { final String isoCode = ISOUtil.zeropad(Integer.toString(code), 3); return findCurrency(isoCode); }
ISOCurrency { public static Currency getCurrency(int code) throws ISOException { final String isoCode = ISOUtil.zeropad(Integer.toString(code), 3); return findCurrency(isoCode); } }
ISOCurrency { public static Currency getCurrency(int code) throws ISOException { final String isoCode = ISOUtil.zeropad(Integer.toString(code), 3); return findCurrency(isoCode); } private  ISOCurrency(); }
ISOCurrency { public static Currency getCurrency(int code) throws ISOException { final String isoCode = ISOUtil.zeropad(Integer.toString(code), 3); return findCurrency(isoCode); } private  ISOCurrency(); @SuppressWarnings({"EmptyCatchBlock"}) static void loadPropertiesFromClasspath(String base); static double convertFromIsoMsg(String isoamount, String currency); static String toISO87String(BigDecimal amount, String currency); static BigDecimal parseFromISO87String(String isoamount, String currency); static void addBundle(String bundleName); static String convertToIsoMsg(double amount, String currency); static Object[] decomposeComposedCurrency(String incurr); static String getIsoCodeFromAlphaCode(String alphacode); static Currency getCurrency(int code); static Currency getCurrency(String code); }
ISOCurrency { public static Currency getCurrency(int code) throws ISOException { final String isoCode = ISOUtil.zeropad(Integer.toString(code), 3); return findCurrency(isoCode); } private  ISOCurrency(); @SuppressWarnings({"EmptyCatchBlock"}) static void loadPropertiesFromClasspath(String base); static double convertFromIsoMsg(String isoamount, String currency); static String toISO87String(BigDecimal amount, String currency); static BigDecimal parseFromISO87String(String isoamount, String currency); static void addBundle(String bundleName); static String convertToIsoMsg(double amount, String currency); static Object[] decomposeComposedCurrency(String incurr); static String getIsoCodeFromAlphaCode(String alphacode); static Currency getCurrency(int code); static Currency getCurrency(String code);  }