Ordering more than 3 digits
Ordering more than 3 digits
karlie
Posts: 83Questions: 17Answers: 0
Hi, I have a column containing only numbers. I can get this to order accurately, but only with 3 digits. As soon as it encounters 4 digits the ordering goes wrong. I'm using server side.
Any ideas?
This discussion has been closed.
Answers
it is being sorted as a string not a number. Number of digits has nothing to do with the issue.
We probably need to see your c ode. We need to figure out why its not automatically detecting its type as number.
Likely it contains non-numeric data somewhere in the column, or you are using server-side processing and the sort is string based.
@bindrid - I read "We probably need to see your c ode." as that the original author was writing code in C for DataTables. That woke me up properly on a Monday morning .
Allan
I can't type a simple sentence. Just imagine what my code looks like
Hi, I exported my database column and I found a rogue underscore in there, however, the problem is still there with that removed
I have tried setting my column setting as:
And I have tried setting my column def as
I've searched for leading and trailing spaces too
Remove that. If DataTables isn't automatically detected it as a number type, the built in number sorting won't work.
Sort the data in both directions. It might show a rouge character.
Allan
If your data is wearing rouge, it might need a good wash.
Oh dear. Now imagine what my code looks like .