This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable not displaying accurate representation of Double  RSS feed

 
Jeff Weeks
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I'm using a JTable to display a list of mostly String values.
There is one Double, however, that is not being displayed properly. For example:
0.0099 displays as 0.01
0.0166 displays as 0.017
It seems that the JTable is rounding to the nearest thousandth decimal place, but I require full accuracy for this table. Is there a way to force full accuracy when outputing Double values?
If I add the value as a String to the table model, the value is properly displayed, but is no longer a number, nor is it properly right aligned, of course.
Any suggestions?
BTW: I store a copy of the beans used in creating each table row, and can confirm that the original double values are unchanged (and still reflect 0.0099, and 0.0166, for example)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!