• Resolved malpica

    (@malpica)


    Hi Tobias,

    I have a problem sorting results.
    If the results are: 96,121, 122 , 123 , 125…

    the results apperars: 121, 122, 123, 125, 96
    If the results have 3 numbers plugin sorts first this results and the end sort the result with only two digits.

    You can see this in my web http://www.mendivilyasciados.com/seguro-vida
    You must populate fields for example with this data:
    Fecha nacmiento: 02/05/1975
    Capital que desea contratar: 100000
    Introduzca su email: insert any mail
    And click “calcular el precio” button

    Best regards

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

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

    (@tobiasbg)

    Hi,

    thanks for your question, and sorry for the trouble.

    I just tried accessing your site, but I only get an error that the domain could not be resolved 🙁 Is this really the correct link?

    Then, this sounds as if you are not sorting numbers. Please make sure that all cells in this column only contain numbers. Otherwise, we will need a different sorting algorithm.

    Regards,
    Tobias

    Thread Starter malpica

    (@malpica)

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks! Now I can see the table.

    The cause for this problem simply is that the cells in this table contain much more than just those numbers, namely an extra link “Detalle del producto” as well as extra HTML code around them. Due to this, the columns are not sorted as numbers, but as text. As text is sorted differently, you get different results.

    To fix this, you could either develop a custom sorting algorithm that extracts the numbers for the sorting, or you could add new (but hidden) columns to the table that only contain the actual numbers and nothing else. Then, you could use the approach that is shown here (for a slightly different example): https://wordpress.org/support/topic/sort-by-height?replies=4

    Regards,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘sort results’ is closed to new replies.