BigDecimal

Pure Kotlin arbitrary-precision signed decimal number backed by JavaScript BigInt.

Represents the value significand * 10^(-scale), mirroring java.math.BigDecimal. This is a custom implementation that may not cover every edge case of the platform decimal types used on other targets.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val scale: Int

Functions

Link copied to clipboard
Link copied to clipboard
fun compareTo(other: BigDecimal): Int
Link copied to clipboard
fun divide(other: BigDecimal, precision: Int = DECIMAL128_PRECISION, rounding: RoundingMode = RoundHalfEven): BigDecimal
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun multiply(other: BigDecimal, precision: Int = DECIMAL128_PRECISION, rounding: RoundingMode = RoundHalfEven): BigDecimal
Link copied to clipboard
fun pow(n: Int, precision: Int = DECIMAL128_PRECISION, rounding: RoundingMode = RoundHalfEven): BigDecimal
Link copied to clipboard
fun round(precision: Int, rounding: RoundingMode): BigDecimal
Link copied to clipboard
fun setScale(newScale: Int, rounding: RoundingMode): BigDecimal
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun toInt(): Int
Link copied to clipboard
fun toLong(): Long
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard