toEngineeringString

fun toEngineeringString(): String

Returns a string representation of this BigDecimal, using engineering notation if an exponent is needed.

Returns a string that represents the BigDecimal as described in the BigDecimal.toString method, except that if exponential notation is used, the power of ten is adjusted to be a multiple of three (engineering notation) such that the integer part of nonzero values will be in the range 1 through

  1. If exponential notation is used for zero values, a decimal point and one or two fractional zero digits are used so that the _scale of the zero value is preserved. Note that unlike the output of BigDecimal.toString, the output of this method is not guaranteed to recover the same [integer, _scale] pair of this BigDecimal if the output string is converting back to a BigDecimal using the aforementioned. The result of this method meets the weaker constraint of always producing a numerically equal result from applying the string constructor to the method's output.

Return

string representation of this BigDecimal, using engineering notation if an exponent is needed.

Since

1.5