Sorting Decimal Values

Sorting Decimal Values

dwadwa Posts: 5Questions: 0Answers: 0
edited March 2009 in Bug reports
Hello everyone:

First let me say I am very impressed with DataTables, it's a fabulous plugin I'm using it more and more in my projects.

I do have a problem though that I can't get sorting on a column with numeric and in my case decimal values to work correctly. I have a list of values coming back sorted like 2.15, 25.19, 4.72, 47.83 etc. With aaSorting turned on for the numeric column only and set to asc the values should be 2.15, 4.72, 25.19, 47.83

Is there something I am missing or is this potentially a bug; wasn't sure where I should post this.

I should point out this happened in 1.4.0 (first version I used), so I upgraded to 1.4.3 it does the same thing.

Thanks kindly in advance.

Replies

  • dwadwa Posts: 5Questions: 0Answers: 0
    I retract my previous statement. Learn to read the docs eh?
    I did not see the entry for sType.
    My apologies for the wasted entry.

    Thanks again.
  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Hi dwa,

    Actually, DataTables should automatically detect columns with numeric data in them. What might have been stopping it from doing so is white space or other non-numeric characters.

    An example of auto-detection of numbers can be seen in the fourth column of this example: http://datatables.net/examples/example_zero_config.html

    Allan
This discussion has been closed.