• Resolved emyb

    (@emyb)


    Hello,

    I have a problem with your extension,

    I have a column with numbers when I sort this column, the sorting is not done well, it is a column with a range of numbers,

    From 280 – 350 the next line is 60 – 90, then 80 – 100, when it should be 280 – 350, 80 -100, 60 – 90 or vice versa (see screenshot : https://zupimages.net/viewer.php?id=21/37/xmya.jpg)

    I hope you understand what I am trying to do

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The cause for this is that these are not pure numbers, but ranges that are then interpreted as text strings. That’s because the sorting algorithm doesn’t know how to handle these: Should it maybe use the first or maybe the second number for the sorting? That’s why it falls back to string sorting, where the first digit decides.

    As an alternative, you could maybe use this approach: https://wordpress.org/support/topic/date-order-6/
    This outlines the same problem (not with number ranges, but with images), but the solution is the same: You add a new hidden column which only has the number that shall be used for the sorting.

    Regards,
    Tobias

    Thread Starter emyb

    (@emyb)

    Okay, thank you for your quick response!

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Problem with sorting’ is closed to new replies.