From 572176c93eef3e6a4791db44e2771be945778efb Mon Sep 17 00:00:00 2001 From: Benko Balog Date: Fri, 7 Oct 2022 17:12:18 +0200 Subject: [PATCH] Remove unnecessary amount usage --- util/src/main/scala/Money.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/src/main/scala/Money.scala b/util/src/main/scala/Money.scala index d4277eeb..68274b18 100644 --- a/util/src/main/scala/Money.scala +++ b/util/src/main/scala/Money.scala @@ -441,7 +441,7 @@ case class HighPrecisionMoney private ( def partition(ratios: Int*)(implicit mode: RoundingMode): Seq[HighPrecisionMoney] = { val total = ratios.sum val factor = Money.cachedCentFactor(fractionDigits) - val amountAsInt = (this.amount / factor).toBigInt + val amountAsInt = BigInt(this.preciseAmount) val portionAmounts = ratios.map(amountAsInt * _ / total) var remainder = portionAmounts.foldLeft(amountAsInt)(_ - _)