Example #1
0
 public long convertFromUsdToUah(long usd) {
   return BigDecimal.valueOf(usd).multiply(Currency.USD.getSellRate()).longValue();
 }
Example #2
0
 public long convertFromUahToUsd(long uah) {
   return BigDecimal.valueOf(uah)
       .divide(Currency.USD.getBuyRate(), RoundingMode.HALF_UP)
       .longValue();
 }