toBigDecimal

JVM
1.2
fun BigInteger.toBigDecimal(): BigDecimal

Returns the value of this BigInteger number as a BigDecimal.

JVM
1.2
fun BigInteger.toBigDecimal(
    scale: Int = 0,
    mathContext: MathContext = MathContext.UNLIMITED
): BigDecimal

Returns the value of this BigInteger number as a BigDecimal scaled according to the specified scale and rounded according to the settings specified with mathContext.

Parameters

scale - the scale of the resulting BigDecimal, i.e. number of decimal places of the fractional part. By default 0.