How come BigDecimal(9105.0).div(BigDecimal(100.toDouble()))
=91.0 instead of 91.05. How do I retain the precision in the decimal?
you use the .div method instead of the .divide method
the kotlin implementation for .div is:
@kotlin.internal.InlineOnly
public inline operator fun BigDecimal.div(other: BigDecimal): BigDecimal = this.divide(other, RoundingMode.HALF_EVEN)
as you can see, there is automatically a RoundingMode activated