WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Sorting - + percentages is not working (2 posts)

  1. grios
    Member
    Posted 8 months ago #

    Hi, I have a row that shows percentage gain or loss like so -22.05% or 22.40% But when sorting by ascending or descending it gets messed up and seems to ignore the - or + aspects so its not being sorted from biggest to loss to biggest gain. Any idea how to fix this? Thank you!

    http://wordpress.org/plugins/tablepress/

  2. TobiasBg
    Member
    Plugin Author

    Posted 8 months ago #

    Hi,

    thanks for your post, and sorry for the trouble.

    The reason for this are not actually the negative and positive numbers, but the percentage sign. Due to that, the cell content is interpreted as a string, and strings are sorted differently than numbers.
    However, you can change this by adding another sorting algorithm. Please see this TablePress Extension for that: http://tablepress.org/extensions/datatables-sorting-plugins/

    Regards,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic