Package com.wesabe.api.util.money

Examples of com.wesabe.api.util.money.Money.convert()


  public static class One_Dollar_Converted_Into_Dollars {
    @Test
    public void shouldBeOneDollar() throws Exception {
      CurrencyExchangeRateMap exchangeRates = new CurrencyExchangeRateMap();
      Money oneDollar = new Money(decimal("1.00"), USD);
      assertEquals(oneDollar, oneDollar.convert(exchangeRates, USD, now()));
    }
  }

  public static class One_Dollar_Converted_Into_Euros {
    @Test
View Full Code Here


    Money total = Money.zero(currency);
    for (Account account : accounts) {
      if (account.hasBalance() && account.isActive()) {
        final Money balance = account.getBalance();
        if (balance != null) {
          total = total.add(balance.convert(exchangeRates, currency, now));
        }
       
      }
    }
    return total;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.