BigDecimal.toPlainString

Returns a string representation of this {@code BigDecimal} without an exponent field. For values with a positive scale, the number of digits to the right of the decimal point is used to indicate scale. For values with a zero or negative scale, the resulting string is generated as if the value were converted to a numerically equal value with zero scale and as if all the trailing zeros of the zero scale value were present in the result.

The entire string is prefixed by a minus sign character '-' (<code>'&#92;u002D'</code>) if the unscaled value is less than zero. No sign character is prefixed if the unscaled value is zero or positive.

Note that if the result of this method is passed to the {@linkplain #BigDecimal(string) string constructor}, only the numerical value of this {@code BigDecimal} will necessarily be recovered; the representation of the new {@code BigDecimal} may have a different scale. In particular, if this {@code BigDecimal} has a negative scale, the string resulting from this method will have a scale of zero when processed by the string constructor.

(This method behaves analogously to the {@code toString} method in 1.4 and earlier releases.)

@return a string representation of this {@code BigDecimal} without an exponent field. @see #toString() @see #toEngineeringString()

class BigDecimal
string
toPlainString
()

Meta