Sheco / cdda-itembrowser

Cataclysm DDA: Item Browser
MIT License
25 stars 10 forks source link

Sorting consumables by spoiling time not working properly #9

Open Nandorianen opened 8 years ago

Nandorianen commented 8 years ago

I think right now it sorts spoil tile as text "X days", which is why 5.00 > 41.25 > 4.00. All these values are given in days, so writing "days" everywhere is redundant. Moving it to the tooltip description of the column would allow sorting these values as numbers, which will result in proper sorting.

Sheco commented 8 years ago

I tweaked this, could you make sure it's now behaving the way you were expecting it to behave?

Nandorianen commented 8 years ago

Sure, it sorts as it should now. Thanks again!

Come to think of it, there are other columns with similar problems. "Weight" in armor, melee, ranged weapons, materials (in last case it's working as it should with current content, but future content may cause similar sorting issues). "Stim" in consumables. Seems to be it. At least everything else seems like proper numbers.