How to sort "numerically"
How to sort "numerically"
![fatshotty](https://secure.gravatar.com/avatar/c806cbe246263c27a713329211681983/?default=https%3A%2F%2Fvanillicon.com%2Fc806cbe246263c27a713329211681983_200.png&rating=g&size=120)
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