WordPress.org

Ready to get started?Download WordPress

Forums

TablePress
[resolved] Problem with sorting numbers (2 posts)

  1. thesoundtrackgeek
    Member
    Posted 10 months ago #

    I have a list which you can find here: http://www.soundtrackgeek.com/v2/soundtrack-geek-index-top-film-scores/

    If you sort on the GS column, the it puts the ones with 100 at the bottom of the list when it should be at the top. Is it because my numbers use comma instead of a period? This is the way Excel use it and I have exported a CSV which I have imported for use in Tablepress.

    Thanks!

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

  2. TobiasBg
    Member
    Plugin Author

    Posted 10 months ago #

    Hi,

    thanks for your post and sorry for the trouble!

    You are right, the reason for this are the commas.
    The JavaScript library that TablePress uses only knows the English number format by default, which uses dots .
    However, there's a TablePress Extension at http://tablepress.org/extensions/datatables-sorting-plugins/ that you can install to change this. After activating that, just add

    "aoColumnDefs": [ { "sType": "numeric-comma", "aTargets": [ 5 ] } ]

    to the "Custom Commands" textfield on the "Edit" screen of the table.

    The other way would be to do a search/replace in Excel and replace the , with a ., if that number format would be ok for you.

    Regards,
    Tobias

Reply

You must log in to post.

About this Plugin

About this Topic

Tags