Default ordering (sorting)
Default ordering (sorting)
I'm trying to sort Prices in my Table but i can't reach result i want with the default sorting of Datatables,
When I'm trying to sort my prices for example
$ 9.00 with respect to $ 8.00 the order is good, but in the case of $ 1,200.00 $ 850.00 does not order them correctly, in the example of the documentation https://datatables.net/examples/basic_init/table_sorting
correctly orders $ 1,200.00 $ 850.00 because the decimal point and the thousands is with " , "
This question has an accepted answers - jump to answer
Answers
Hi @reing.prog ,
That should still be fine, see this example here. If it's not sorting for you, it suggests there's some stray characters in one of those fields that's breaking the type detection.
If the problem exists after you've checked your data, could you update my example to demonstrate the problem, please.
Cheers,
Colin
Hi Colin, thank you for answering me, unfortunately I got confused when exemplifying, obviously this is how ordering works perfectly, where it does not work for me is 1,200.00 $ 850.00 where the decimal point is "," and the thousand is ".", thank
Not work for 1.200,00 $ 850,00
Hi @reing.prog ,
Yep, you need to say if it's different, see this modified example here,
Cheers,
Colin
Gratefully, that was what I was missing