Java BigDecimal.toPlainString()
成为我的应用程序的热点。有没有更快的方法来获取 BigDecimal
的纯字符串?
最佳答案
toString()
方法可以是一个选项。
但只是对其进行了测试,toPlainString() 无疑是赢家。
来自 Oracle 文档:
String toPlainString() Returns a string representation of this BigDecimal without an exponent field.
String toString() Returns the string representation of this BigDecimal, using scientific notation if an exponent is needed.
关于Java BigDecimal.toPlainString() 性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34770962/