Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Re: Sorting numeric strings (http://www.velocityreviews.com/forums/t945864-re-sorting-numeric-strings.html)

Arne Vajh°j 05-01-2012 01:39 AM

Re: Sorting numeric strings
 
On 4/30/2012 9:27 PM, Ben wrote:
> Given the following data:
>
> Col1, Col2, Col3
> 438.23, 991897664, ccc
> 22.12, 991897631, bbb
> 100.99, 881897631, aaa
> 50.12, 991884803, ddd
>
> The class below will sort the data based on the column specified, except
> Col1, which contains float values. If you set the SortCol variable below
> to 0, sorting does not work. If you set it to 1 or 2, sorting does work.
> How can I sort Col1 which is a column of numeric strings?


I only works with Col2 because the strings has same length.

If you need to sort after numerical value, then you need
to convert values to numbers.

Arne



All times are GMT. The time now is 08:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.