I need to sort a column in a listview control that holds currency value. I know that all data is treated as characters within listview so straight sorting doesn't work. Thus, I'm using the following code to sort it:
For Each itmX In .ListItems
itmX.SubItems(lngColIndex - 1) = Format$(itmX.SubItems(lngColIndex -
1), "Z0000000000.00;A0000000000.00")
Next itmX
Above code will sort the "positive" currency values correctly but still doesn't sort the negative values correctly. Thus I get:
20.00
10.00
5.00
0.00
-20.00
-10.00
-5.00
Does anyone have a clever way to sort it properly? I'm thinking one way to do it is to copy it to a array/collection, sort it and then place it back in the correct order but this seems to be a lot of work so... TIA.
It's "my" world. You're just living in it.