Support » Plugin: TablePress - Tables in WordPress made easy » Numerical ordering

  • Resolved normski

    (@normski)


    Hi. The numbers in a list appear to order by reference to the first digit rather than the whole number. For example, 1, 3, 4, 10, 21 will order 1,10,21,3,4.

    Is there a way of fixing this so that they order by whole number?

    Many thanks

    N

    https://wordpress.org/plugins/tablepress/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The reason for this most likely is that not all cells in that column are numbers, but that there’s also text in that column. That changes the sorting algorithm to that for text strings.
    Could that be the reason?

    Regards,
    Tobias

    Thread Starter normski

    (@normski)

    Many thanks, Tobias, for your prompt response! The infromation contains percentages so it includes the % symbol. Might that be it? Also there is no problem when I try to sort the data wthin WP dashboard. The problem only arises when visitors to the website attempt to do so.

    cpmstech

    (@cpmstech)

    Tobias,

    We are currently trying to sort by date and it works fine on the back end, but as soon as we try to sort it on the front end, it doesn’t sort correctly. It looks like it is sorting by the first number which is in America, the month. Is there a way to have it sort like it is sorting on the back end by the entire date taking the day, month, and year into consideration at the same time.

    Here is a link to our table, if you could take a look at it and tell us what you think, that would be great. Thanks for your time.

    Another problem that we are having, is the search function on our table isn’t searching by dept correctly. E.G., if you were to type in IT, we would hope that it would show all the IT departments. Any light that you could shed on this matter would be greatly appreciated.

    http://researchdevelopment.byu.edu/search-tools/targ-fund-ann

    CPMS

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    @cpmstech: I’ll reply to your question in the thread at http://wordpress.org/support/topic/sorting-tables-by-date to keep this thread separate.

    Regards,
    Tobias

    Steve B

    (@sbwebmaster)

    I noticed this problem as well when using dollar amounts.

    For example, sorting from lowest to highest, I get:

    $9.99
    $9.99
    $9.99
    $9.59
    $9.45
    $8.99
    $8.99
    $8.53
    $8.49
    $10.69

    Please advise,
    SB

    PS. This is one of the most useful plugins for WordPress by far. Thank you!

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    Yes, dollar amounts are also strings and not numbers.
    To change this, please use this TablePress Extension: http://tablepress.org/extensions/datatables-sorting-plugins/

    Regards,
    Tobias

    Steve B

    (@sbwebmaster)

    Hi Tobias,

    That did the trick. Continue your great work!

    Best,
    SB

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Numerical ordering’ is closed to new replies.