Pages

Monday, June 29, 2009

WTF: BigDecimal.stripTrailingZeros().toPlainString()

(new BigDecimal("1.00")).stripTrailingZeros().toPlainString(); // "1"
(new BigDecimal("0.00")).stripTrailingZeros().toPlainString(); // "0.00"

2 comments:

Lauri said...

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539

Unknown said...

Lauri,

Submit date for this bug is 11-OCT-2006 (almost 3 years old now), and my Java version is 1.6.0-11 :)

Disqus for Code Impossible