W3cubDocs

/Kotlin

toBigDecimal

Platform and version requirements: JVM (1.2)
fun BigInteger.toBigDecimal(): BigDecimal

Returns the value of this BigInteger number as a BigDecimal.

Platform and version requirements: 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.

© 2010–2020 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/java.math.-big-integer/to-big-decimal.html