This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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:
Joined: May 19, 2010
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Sorting JTable with scientific notation doubles in Win32