Mabinogi World Wiki is brought to you by Coty C., 808idiotz, our other patrons, and contributors like you!!
Want to make the wiki better? Contribute towards getting larger projects done on our Patreon!

Forum - Sorting algorithm in all tables is borked

Overview > Mabinogi World Wiki > Help & Reports > Sorting algorithm in all tables is borked
[#66]

It appears that trying to sort anything in a table that is a number only sorts by the first digit. It completely messes up all enchants, repair costs, or anything numeric. Try repairs here Or potential increases here

I'm new here so I don't know where the code is located but if I had to guess based off past experience someone trying to be clever typecast all data into strings to try and "simplify" things. Unfortunately this naive approach now means that now 29 < 3.

Posted by Blackcatz13 on 9 August 2017 at 19:30.
Edited by Blackcatz13 on 9 August 2017 at 19:34.

Oh hey~ Yeah, I remember this issue. It has been around for... a number of years xD; At least in regards to the Enchants table, simply refreshing the page will put the list in order from Max. to Min., since that's how they're listed originally.

Think the issue is buried deep in the Wiki code, maybe - On a Discussion page this link was given: https://en.wikipedia.org/wiki/Template:Number_table_sorting

I'll check it out later/tomorrow - since it doesn't appear to be a simple fix (at least for my skill level xD; )

Posted by Elide on 10 August 2017 at 05:15.

I'm not even sure it's our code. @.@ The main issue with changing it is that there are "numerical" columns with ranges in them so it's extra annoying. Since what Elide linked is just done in template code it might be possible to do that while selecting only the maximum roll for the formatted number output. Feel free to do.

Posted by Kadalyn (administrator) on 10 August 2017 at 10:18.

Ok, so sorting should be a little bit more correct with the addition of data-sort-type="number". At least now it seems to realize that 29 > 3 in the appropriate column. Hasn't appeared to mess up anything so far. Will keep at it unless something explodes /o/

Posted by Elide on 10 August 2017 at 20:33.

Ahh surprised it works well with the ranges just like that. :D Thanks!

Posted by Kadalyn (administrator) on 12 August 2017 at 03:07.