Can you force "order" option to interpret and sort data as numeric rather than string?
Can you force "order" option to interpret and sort data as numeric rather than string?
AdamCMP
Posts: 1Questions: 1Answers: 0
My data (a list of IDs) is being read and sorted as strings. This results in order like:
1, 10, 11 ... 2, 20, 21 ... 3, 30, etc.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @AdamCMP ,
DataTables normally detects the type if the column is all numbers like that. It would be worth checking the data to make sure there's no non-numeric characters in there.
If it looks good, you can force the type with
columns.type
, and specifynum
.Cheers,
Colin