How to sort "numerically"
How to sort "numerically"
fatshotty
Posts: 2Questions: 0Answers: 0
Hello,
I need sort column as "numeric".
I used this code
[code]
// passing options in costructor
"aoColumnDefs": [
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] }
]
[/code]
Columns are sorted as "string"
Any help?
I need sort column as "numeric".
I used this code
[code]
// passing options in costructor
"aoColumnDefs": [
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] },
{ "sType": "numeric", "aTarget": [0] }
]
[/code]
Columns are sorted as "string"
Any help?
This discussion has been closed.
Replies
Regards
Claus
I found out, instead, the reason: I have columns containing numbers in "Italian" format (eg: 3.000,02). This causes DataTables script thinks it's a string.
How can I use a custom sorting function?
Thanks
Allan