Add the sign percent modify sort

Add the sign percent modify sort

Super_carotteSuper_carotte Posts: 11Questions: 1Answers: 0
edited April 2014 in General
Hello every body :)

I would like to put the sign "%" after my numbers but it modifies the sort. I understand why (conversion to text instead of numbers) but I would like to know how can I do it because I need to see the "%" after my numbers.

Does anyone know how to do it?

Thank a lot for your help :)

Exemple: without the sign it's ok:
13500
436.23
229.07
206.85
71.85
66.28
50
45.53
21.02
4.73
2.36
0
0
-3.25
-10.44
-16.61
-20.36
-23.92
-100


But with the sign the asc sort doesn't work anymore:
71.85 %
66.28 %
50%
45.53 %
436.23 %
4.73 %
229.07 %
21.02 %
206.85 %
2.36 %
13500%
0%
0%
-3.25 %
-23.92 %
-20.36 %
-16.61 %
-100%
-10.44 %

Replies

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Try using DataTables 1.10: http://next.datatables.net/download . It has percentage sorting built in. Although you would need to remove the space between the numbers and the symbol.

    Allan
  • Super_carotteSuper_carotte Posts: 11Questions: 1Answers: 0
    Thank you, it works well :)

    For your information, it works well even with a space between the numbers and the symbol.

    Now I got:
    13500 %
    436.23 %
    229.07 %
    206.85 %
    71.85 %
    66.28 %
    50 %
    45.53 %
    21.02 %
    4.73 %
    2.36 %
    0 %
    0 %
    -3.25 %
    -10.44 %
    -16.61 %
    -20.36 %
    -23.92 %
    -100 %
  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Good stuff - I'll need to check my code and make sure I undefended that, but good to hear it works :-)

    Allan
This discussion has been closed.