W3cubDocs

/Kotlin

toBigDecimal

inline fun Int.toBigDecimal(): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Int number as a BigDecimal.

inline fun Int.toBigDecimal(
    mathContext: MathContext
): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Int number as a BigDecimal.

Parameters

mathContext - specifies the precision and the rounding mode.

inline fun Long.toBigDecimal(): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Long number as a BigDecimal.

inline fun Long.toBigDecimal(
    mathContext: MathContext
): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Long number as a BigDecimal.

Parameters

mathContext - specifies the precision and the rounding mode.

inline fun Float.toBigDecimal(): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Float number as a BigDecimal.

The number is converted to a string and then the string is converted to a BigDecimal.

inline fun Float.toBigDecimal(
    mathContext: MathContext
): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Float number as a BigDecimal.

The number is converted to a string and then the string is converted to a BigDecimal.

Parameters

mathContext - specifies the precision and the rounding mode.

inline fun Double.toBigDecimal(): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Double number as a BigDecimal.

The number is converted to a string and then the string is converted to a BigDecimal.

inline fun Double.toBigDecimal(
    mathContext: MathContext
): BigDecimal

Platform and version requirements: Kotlin 1.2, JVM

Returns the value of this Double number as a BigDecimal.

The number is converted to a string and then the string is converted to a BigDecimal.

Parameters

mathContext - specifies the precision and the rounding mode.

© 2010–2018 JetBrains s.r.o.
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/to-big-decimal.html