of

fun of(unscaledVal: Long, scale: Int): BigDecimal

Translates a long unscaled value and an int _scale into a BigDecimal.

Return

a BigDecimal whose value is (unscaledVal 10<sup>-_scale</sup>).

Parameters

unscaledVal

unscaled value of the BigDecimal.

scale

_scale of the BigDecimal.

fun of(unscaledVal: Long, scale: Int, prec: Int): BigDecimal

Translates a long value into a BigDecimal with a _scale of zero.

Return

a BigDecimal whose value is val.

Parameters

val

value of the BigDecimal.

fun of(val: Int): BigDecimal
fun of(val: Long): BigDecimal
fun of(intVal: BigInteger, scale: Int, prec: Int): BigDecimal
fun of(val: Float, ctx: MathContext = MathContext.UNLIMITED): BigDecimal
fun of(val: String, ctx: MathContext? = null): BigDecimal
fun of(val: BigInteger, ctx: MathContext? = null): BigDecimal
fun of(val: Int, ctx: MathContext): BigDecimal
fun of(val: Long, ctx: MathContext): BigDecimal
fun of(val: Double, ctx: MathContext = MathContext.UNLIMITED): BigDecimal

Translates a double into a BigDecimal, using the double's canonical string representation provided by the Double.toString method.

Return

a BigDecimal whose value is equal to or approximately equal to the value of val.

Since

1.5

Parameters

val

double to convert to a BigDecimal.

Throws

if val is infinite or NaN.