Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sorting ListView by Number

Status
Not open for further replies.

spence74

Programmer
Jul 16, 2004
34
US
Does anyone have any information to get a listview to sort numerical data correctly?

For example, I have a listview with the following values:
35
50
10
117
425
425

When I sort by this column, I get:
10
117
35
425
425
50

I realize that this would be the correct sort order for text data... How can I get it to sort correctly for numeric data?

Thanks!
 
Numbers will sort correctly if they have leading zeros.

So it could be like this:
010
035
050
117
425
425

 
Hmmm, but that won't work too well on a mix of positive and negative numbers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top