Support » Plugin: TablePress » Sorting not working with negative values/large currencies

  • Resolved sherrie.gonzalez



    I’m trying out your plugin for the first time this week and I have to say, it’s really great. The only issue I’m having is with the sorting. (I did install the sorting extension, btw) I set up a chart that has values for change in price on homes so there’s negative values of percentages that are sorting incorrectly because they’re basically just looking at the first number. Also, large values with currency are not sorting properly either. I did a test and I either had to take out the comma or the dollar sign to get the numbers to sort correctly. We also have some entries that are ‘N/A’ and they rank to the top in the sorting because it doesn’t know how to interpet the string. /: I might be able to fix those by using js to give them a value of 0. If you have any suggestions, I would appreciate them! And I’m sorry if this has been addressed but I spent quite some time going through the forums along with searching google and still came up short. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Oh, it’s actually not working with commas at all I just realized for the larger values. /:

    Actually fixed it! Thanks!

    Plugin Author TobiasBg


    Hi Sherrie,

    thanks for your post, and sorry for the trouble.

    Yes, the sorting by default (as it comes from the external DataTables JavaScript library from only has basic number types for sorting.
    Things like percentages or currency values require more attention. The Sorting Plugins Extension is usually quite good at that, but sometimes the automatic detection of the sort type still fails. It is then usually possible to manually set that sort type though.
    Columns with text, like “N/A” are however critical. As these are not numbers, the script just doesn’t know how to treat them, so that avoing such entries is in general recommended.

    Best wishes,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sorting not working with negative values/large currencies’ is closed to new replies.