toString

open override fun toString(): String(source)

Returns the shortest ordinary decimal representation that preserves this exact numeric value.

The result never uses scientific notation. Negative zero is formatted as 0.


fun toString(decimalPlaces: Int): String(source)

Formats this value with exactly decimalPlaces fractional digits.

This is exact formatting, not rounding. Throws ArithmeticException if the value has meaningful precision beyond decimalPlaces. decimalPlaces must be in 0..9.