Java Performance BigDecimal.toPlainString ()

Java is BigDecimal.toPlainString()becoming the hot spot of my application. Is there a faster way to get a simple string BigDecimal?

+4
source share
1 answer

toString() may be an option.

But just tested the test on it, toPlainString () was the clear winner.

From Oracle docs:

String toPlainString () Returns a string representation of this BigDecimal without an exponent field.

String toString () Returns a string representation of this BigDecimal, using scientific notation if exponent is required.

+1
source

Source: https://habr.com/ru/post/1624150/


All Articles