P
Paul
I have a field that contains both numeric and alphanumeric entries, so
e.g. when I do an 'order by' in sql I would get the following order
1.2
1.25
1.3
3
50
6
ALMERA
FOCUS
But in this case , the 6 should be above the 50, but the order by
looks at the first digit only.
To get around this, I tried two implemetations of the comparator class
that I found on the web
http://pierre-luc.paour.9online.fr/NaturalOrderComparator.java and
http://www.davekoelle.com/alphanum.jsp. These seemed to work well
EXCEPT for the cases containing decimal points
i.e. in the following order
1.2
1.3
1.25
Does anyone know of a sort that gets around this problem.
e.g. when I do an 'order by' in sql I would get the following order
1.2
1.25
1.3
3
50
6
ALMERA
FOCUS
But in this case , the 6 should be above the 50, but the order by
looks at the first digit only.
To get around this, I tried two implemetations of the comparator class
that I found on the web
http://pierre-luc.paour.9online.fr/NaturalOrderComparator.java and
http://www.davekoelle.com/alphanum.jsp. These seemed to work well
EXCEPT for the cases containing decimal points
i.e. in the following order
1.2
1.3
1.25
Does anyone know of a sort that gets around this problem.