• Love the plugin and just made a donation. One question I have is although sorting works, it bases the sort on the first numeric digit in a cell and doesn’t seem to take into account the actual value of the number.

    for example, when the sort is set to ascending, any cell with a 1 will appear before a cell with a value that starts with a higher digit regardless of the fact that 111,111 is a larger number than 2,222.

    How do I correct this?

    Thanks in advance!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    this is related to how the DataTables library recognizes numbers and strings.

    Currently, number can’t have a comma in them as a thousand separator. If a cell does, it is recognized as a string. And strings are sorted differently than numbers.

    The only solution currently is to not use thousand separators, i.e. remove all , from your numbers.

    I’m working on a solution (as a WP-Table Reloaded Extension) to allow them in numbers too, but I don’t know yet, when it will be ready.

    Best wishes,
    Tobias

    Thread Starter adaptistration

    (@adaptistration)

    that makes complete sense, thanks for the prompt reply. If you think you can have the extension completed in the next two weeks, please let me know (and if it can handle inserting a $ sign at the beginning of figures, that would be fantastic but not a show stopper).

    e-ivanoff

    (@e-ivanoff)

    Really nice plugin. But..
    But looks like it cant sort decimal digits.
    I mean digits thats more then 10.
    In my table them sorts only by first digit (

    Hi,

    e-ivanoff, you are experiencing the same thing as described above. Your values in the table are recognized as strings and not numbers and therefore sorted differently.

    Can you check if you have anything of the following in your table:
    – letters or characters other than numbers 0 to 9
    – spaces or blanks or empty cells
    – commas

    If yes, try removing all of them, please.
    Also, please provide a link to the page with your table, and I will have a look at it.

    Best wishes,
    Tobias

    e-ivanoff

    (@e-ivanoff)

    Hi Tobias!
    Thanks for the answer
    looks like that, but only first column(fist column whith $ symbol) of my table sorts wrong way.
    And i don`t understand why.
    May be becose i use cyrilic symbols in other cells of row ?
    http://more-pan(**remove it**)sionatov.ru/news/zapadnyj-krym-luchshie-predlozheniya/

    Hi,

    oh, ok. That explains it. Yes, I believe it is because of the cyrillic symbols then. Unfortunately, I don’t know how to fix that, you might need to ask in the Support Forums of the DataTables JavaScript library at http://www.datatables.net.

    Best wishes,
    Tobias

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

The topic ‘[Plugin: WP-Table Reloaded] table sorting functions by first digit only’ is closed to new replies.