@Test public void testtoISO87String () { assertEquals("000000001234", ISOCurrency.toISO87String(new BigDecimal("12.34"), "840"), "2 decimals"); assertEquals("000000001234", ISOCurrency.toISO87String(new BigDecimal("1.234"), "048"), "3 decimals"); assertEquals("000000001234", ISOCurrency.toISO87String(new BigDecimal("1234"), "020"), "no decimals"); }
public static String toISO87String (BigDecimal amount, String currency) { try { Currency c = findCurrency(currency); return ISOUtil.zeropad(amount.movePointRight(c.getDecimals()).setScale(0).toPlainString(), 12); } catch (ISOException e) { throw new IllegalArgumentException("Failed to convert amount",e); } }
ISOCurrency { public static String toISO87String (BigDecimal amount, String currency) { try { Currency c = findCurrency(currency); return ISOUtil.zeropad(amount.movePointRight(c.getDecimals()).setScale(0).toPlainString(), 12); } catch (ISOException e) { throw new IllegalArgumentException("Failed to convert amount",e); } } }
ISOCurrency { public static String toISO87String (BigDecimal amount, String currency) { try { Currency c = findCurrency(currency); return ISOUtil.zeropad(amount.movePointRight(c.getDecimals()).setScale(0).toPlainString(), 12); } catch (ISOException e) { throw new IllegalArgumentException("Failed to convert amount",e); } } private  ISOCurrency(); }
ISOCurrency { public static String toISO87String (BigDecimal amount, String currency) { try { Currency c = findCurrency(currency); return ISOUtil.zeropad(amount.movePointRight(c.getDecimals()).setScale(0).toPlainString(), 12); } catch (ISOException e) { throw new IllegalArgumentException("Failed to convert amount",e); } } 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 String toISO87String (BigDecimal amount, String currency) { try { Currency c = findCurrency(currency); return ISOUtil.zeropad(amount.movePointRight(c.getDecimals()).setScale(0).toPlainString(), 12); } catch (ISOException e) { throw new IllegalArgumentException("Failed to convert amount",e); } } 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);  }