However I stumbled upon a sorting issue within our application. Whenever I sort an entire column in a MultiColumnList, that is made out of ListboxItems that only contains numbers, it is sorted character-wise instead of number-wise.
I'll give you an example. Let's say we have a MultiColumnList that contains a list with servers with 3 columns: "Hostname", "IP" and "Ping". The "Ping" column would contain numbers only, unlike the other ones.
I'll use the following rows for a MultiColumnList.
Code: Select all
[Hostname] - [IP] - [Ping]
Server A - 10.0.0.1 - 4
Server B - 10.0.0.4 - 69
Server C - 10.0.0.9 - 40
Server D - 10.0.0.56 - 10
Now say we wanted to sort on pings. We would click the "Ping" header and in a perfectly coded application this would pop out (4 < 10 < 40 < 69):
Code: Select all
Server A - 10.0.0.1 - 4
Server D - 10.0.0.56 - 10
Server C - 10.0.0.9 - 40
Server B - 10.0.0.4 - 69
However, in my case this would be the result:
Code: Select all
Server D - 10.0.0.56 - 10
Server A - 10.0.0.1 - 4
Server C - 10.0.0.9 - 40
Server B - 10.0.0.4 - 69
You can see the numbers are not interpreted as numbers but as strings/text. I'm passing normal CEGUI::String's containing the numbers to a CEGUI::ListboxTextItem constructor. I have no funky modes set whatsoever cause I don't know any. This is probably where I went wrong.
Bottom line: how do i sort numbers number-wise (1, 2, 3, 4, 5, 25, 33, etc.) instead of string-wise (1, 2, 25, 3, 33, 4, 5, etc.)?