Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sorting JTable with scientific notation doubles in Win32

 
Fernando Muniz
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have quite an opaque problem.

I have a regular JTable that I have filled with values coming from a text file, a report. Some of these fields contain double numbers, formatted in the scientific way (e.g. 1.25E-7).
My methodology is to parse these strings to a double and fill the table column with the result. On failure to parse the number, I insert a "Double.NaN"



Next I have a table sorter. As the code is now, if you click on the column header containing the double numbers, it will sort the scientific notation values correctly under Linux, Mac, and WindowsXP 64bits but NOT under WindowsXP 32bits. In that OS, it seems to sort the rows by its string value, not as a scientific notation double (eg. 1.25E-3 before 2.56E-5).
What the 'ellll am I doing wrong!?

Here is the row sorter code:

 
Fernando Muniz
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, OK... I'll kick myself in the butt for blindness induced stupidity....



Just removed this part and it worked.
Move on, nothing to see!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic