Default ordering (sorting)

Default ordering (sorting)

reing.progreing.prog Posts: 11Questions: 3Answers: 0

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

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

  • reing.progreing.prog Posts: 11Questions: 3Answers: 0

    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

  • reing.progreing.prog Posts: 11Questions: 3Answers: 0

    Not work for 1.200,00 $ 850,00

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    Hi @reing.prog ,

    Yep, you need to say if it's different, see this modified example here,

    Cheers,

    Colin

  • reing.progreing.prog Posts: 11Questions: 3Answers: 0

    Gratefully, that was what I was missing

This discussion has been closed.