This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Float type in JTable  RSS feed

 
Roy Wira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have a problem here, it actually has something to do with the floating point significance.
I need to display a fixed format of 8.2 data with float type in JTable's cell. When I put the value to JTable, it turns out that my value has some additional numbers behind the comma.
Example:
float abc = 123456.78;
When I put it in JTable it displays 123456.781
Can anyone help me with this ? I'm jdk1.3 user.
Do I need to use DecimalFormat and change it to String?
Thx,
Roy
[ October 11, 2002: Message edited by: Roy Wira ]
 
Bal Mark
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make yourself a nice shiney new TableCellRender and override your
java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
 
Paul Stevens
Ranch Hand
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Balmark is right and ...

Welcome to the JavaRanch! Please adjust your display name to meet
the JavaRanch Naming Policy. You can change it here.
Thanks!
and welcome to the JavaRanch!
 
Roy Wira
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!