• kancur

    (@kancur)


    My table: https://www.good3dprojector.com/best-3d-hd-projector/

    The problem is the contrast ratio column. It’s working except the 1,000,000 number

    Actually ideal would be if I can put there values like this: 15,000:1 and to sort only by the first number = 15,000 but that is not priority ?? thanks for your help, I can’t figure out how to make it work

Viewing 11 replies - 1 through 11 (of 11 total)
  • TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    You are right, numbers with a comma as a thousand separator will not work out of the box, as the comma makes those numbers strings, and strings are sorted differently. To work around that, please install the TablePress Extension from https://tablepress.org/extensions/datatables-sorting-plugins/ and add this to the “Custom Commands” textfield on the “Edit” screen of the table:

    "aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 1, 3 ] } ]

    Regards,
    Tobias

    Thread Starter kancur

    (@kancur)

    Thanks for your response, I have already tried it. It’s not working for me :-/ But the currency column is working without problem. Only problem seems to be the 1,000,000 number. Sorry I’m a beginner in wordpress and so on

    Thread Starter kancur

    (@kancur)

    I reuploaded that plugin to be sure. No change.
    Here is another example https://www.good3dprojector.com/test-page/
    Password:123

    This is the code I put in Custom commands:
    "aoColumnDefs": [ { "sType": "formatted-num", "aTargets": [ 6 ] } ]

    Still it seems that numbers with , as thousands separator are treated as if , is a decimal separator! I don’t get it.

    Thank you very much for spending your time on this ??

    TobiasBg

    (@tobiasbg)

    Hi,

    from what I can see, you are using a second piece of JavaScript for the sorting, besides the DataTables library that TablePress uses.
    Namely, there’s a “jquery.tablesorter.js” script being loaded. My assumption is that that is interfering right now, so please turn that off again so that we can further investigate this.

    Regards,
    Tobias

    Thread Starter kancur

    (@kancur)

    Oh yeah!! ?? Thank you, sorry I’m a total newbie in this.
    Thank you very much! Your plugin is awesome!

    TobiasBg

    (@tobiasbg)

    Hi,

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

    Best wishes,
    Tobias

    Thread Starter kancur

    (@kancur)

    ?? I have one more question, can you suggest me a solution to sorting column: Resolution
    It could be based on sorting just the first number before x character.
    or maybe x could work as a multiplication …

    Thread Starter kancur

    (@kancur)

    (Somehow the link is not visible in previous post)
    Link:
    https://www.good3dprojector.com/

    TobiasBg

    (@tobiasbg)

    Hi,

    sorry, unfortunately, I don’t have a solution to that. That’s a similar problem as sorting for those ratios with the :. You would need to develop a custom sorting algorithm in JavaScript that extracts that number from the cell and uses it for the sorting, similar to the other algorithms in the Sorting Plugins Extension.

    Regards,
    Tobias

    Thread Starter kancur

    (@kancur)

    Anyway, thank you very much ??

    TobiasBg

    (@tobiasbg)

    Hi,

    sure, no problem! Sorry that I couldn’t help with that.

    Regards,
    Tobias

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Tablepress thousands separator problem’ is closed to new replies.