Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter dcwebcat

    (@dcwebcat)

    Never mind. If I add a zero in front of a single digit, it will sort correctly.

    Do we always needs to put the zero in front if there is a single digit or is there a setting somewhere?

    Thank you

    Plugin Author Tobias B?thge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    The problem here actually are the “Coming Soon” and the “40 & 41” entries. Those are not plain numbers, so that the DataTables JS library falls back to sorting the column as strings.

    With the prepended 0, you’ll now get the desired result, even with string sorting. If you don’t want to add that 0 here, you’ll have to remove those “Coming Soon” and “40 & 41” entries, so that the column can be treated as numeric.

    Regards,
    Tobias

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Sorting Numbers in Column’ is closed to new replies.