Sorting does not work as required! Pls help!
Sorting does not work as required! Pls help!

Hi there, one of my columns consist of monetary value (cost) and when I hit sort, it only sorts it alphabetically. This table was generated from a dataframe to HTML. This column in the dataframe had data type float64. Can anyone help. Heres an example when I hit low to high: 120.90, 20495.45, 21.47, 345.01, 45.00.
It just looks at the first digit.
This discussion has been closed.
Replies
If Datatables thinks its a non-numeric column you may have some other non-numeric data in the column. You can try using
column.type
and set it tonum
. If this doesn't work then we 'll need to see an example of the problem. Please post a link to your page or a test case replicating the issue.https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
Thanks Kevin for the speedy reply! So youre completely right.. some of the data had a NaN type, so I took them out and it worked a treat
thanks.