• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Sorting JTable with scientific notation doubles in Win32

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic