Exemplo n.º 1
0
 public Money applying(Ratio ratio, int scale, int roundingRule) {
   BigDecimal newAmount = ratio.times(amount).decimalValue(scale, roundingRule);
   return Money.valueOf(newAmount, currency);
 }
Exemplo n.º 2
0
 public Ratio dividedBy(Money divisor) {
   assertHasSameCurrencyAs(divisor);
   return Ratio.of(amount, divisor.amount);
 }