I have a class with the following function:
Code:Public Function CompareTo(ByVal obj As Object) As Integer _ Implements System.IComparable.CompareTo If Not TypeOf obj Is TicketData Then Throw New Exception("Object is not MyObject") End If Dim Compare As TicketData = CType(obj, TicketData) Dim result As Integer = Me.strSLA.CompareTo(Compare.strSLA) If result = 0 Then result = Me.strSLA.CompareTo(Compare.strSLA) End If Return result End Function
Presort I get the following data:
PRESORT
6721.04
3901.46
2768.12
2408.12
795.42
2377.29
2145.21
1866.25
1775.83
after running ticketList.Sort() I get:
SORTED
1.94
102.15
1180
129.58
13.54
133.33
139.17
148.33
1571.88
So it appears that my function is comparing as if it were a string. Can someone help me understand what I'm missing?




Reply With Quote