safeToBigDecimal

fun String.safeToBigDecimal(defaultValue: BigDecimal, mathContext: MathContext? = null): Serializable(source)

Parses the string as a java.math.BigDecimal number and returns the result.

Since

0.1.0

Parameters

defaultValue

Return if the string is not a valid representation of a number.

mathContext

Specifies the precision and the rounding mode.