Table not sorting when having decimals and high numbers in same column? HELP Please - Link supplied

Table not sorting when having decimals and high numbers in same column? HELP Please - Link supplied

simonjuhlsimonjuhl Posts: 4Questions: 0Answers: 0
edited March 2011 in General
Hi guys.

First i just gotta say that datatables is awesome :) Got a problem though which is kinda annoying.

When having decimals and large numbers in the same column datatables are not able to sort it properly ?

Check it out here: http://pricebook.dk/mobil-abonnement.html

Try to sort by "Data in the 2nd column from the right and you will see that 12 and 5 are not placed as they should be after sorting.

All help is much appreciated. I hope a simple script should help me to fix this problem... Thank you guys...

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin
    It's not numeric data that you are trying to sort (i.e. there are characters other than 0-9 and .-), so you need to take that into account with a sorting plug-in. This one might do the trick: http://datatables.net/plug-ins/sorting#formatted_numbers - or they are fairly easy to customise for whatever format you want.

    Allan
  • simonjuhlsimonjuhl Posts: 4Questions: 0Answers: 0
    Thanks for the reply allan. Unfortunately that didnt work for me :( . But it seems like that i have the problem even tough it is only numeric data i got in the column. So maybe it is a general error? Maybe you can make a plugin that excludes which in my brackets "()" and then only account for raw data for something..
This discussion has been closed.