sort negative and positive numbers

sort negative and positive numbers

webguruwebguru Posts: 16Questions: 0Answers: 0
edited September 2010 in General
I have a chart with a column showing a change in totals so the values are preceded by "+" and "-" . Rows with no change show as "-". So the values look like so:

+3
+2
+1
-
-1
-2
-3

How can I get the tables sorted like this.

Replies

  • leokormaleokorma Posts: 7Questions: 0Answers: 0
    Hi there, i got another problem when sorting numbers.
    In my case it looks like this:

    -5.1
    -10.6
    +1
    +3

    so negative numbers should be in different order because -10.6 is much smaller than -5.1
    so it should be like:

    -10.6
    -5.1
    +1
    +3

    does anyone knows what to do?
    Thanks in advance.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    You need a sorting plug-in which will strip the plus sign and then sort numerically. There aren't any available which currently do this, but it is a fairly easy modification from the ones which are available: http://datatables.net/plug-ins/sorting

    Allan
  • leokormaleokorma Posts: 7Questions: 0Answers: 0
    Thanks, i take a look and try to create my own plugin.
This discussion has been closed.