W3cubDocs

/Kotlin

toBigDecimal

inline fun BigInteger.toBigDecimal(): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this BigInteger number as a BigDecimal.

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

Platform and version requirements: Kotlin 1.2, JVM

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–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/java.math.-big-integer/to-big-decimal.html