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