toDecimal

fun Number.toDecimal(): BigDecimal

Converts this number into an arbitrary-precision BigDecimal, by parsing its String representation.

Throws

if this number's String representation is not a valid decimal literal