Title: Numerical ordering
Last modified: August 21, 2016

---

# Numerical ordering

 *  Resolved [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/)
 * Hi. The numbers in a list appear to order by reference to the first digit rather
   than the whole number. For example, 1, 3, 4, 10, 21 will order 1,10,21,3,4.
 * Is there a way of fixing this so that they order by whole number?
 * Many thanks
 * N
 * [https://wordpress.org/plugins/tablepress/](https://wordpress.org/plugins/tablepress/)

Viewing 8 replies - 1 through 8 (of 8 total)

 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729487)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * The reason for this most likely is that not all cells in that column are numbers,
   but that there’s also text in that column. That changes the sorting algorithm
   to that for text strings.
    Could that be the reason?
 * Regards,
    Tobias
 *  Thread Starter [normski](https://wordpress.org/support/users/normski/)
 * (@normski)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729521)
 * Many thanks, Tobias, for your prompt response! The infromation contains percentages
   so it includes the % symbol. Might that be it? Also there is no problem when 
   I try to sort the data wthin WP dashboard. The problem only arises when visitors
   to the website attempt to do so.
 *  [cpmstech](https://wordpress.org/support/users/cpmstech/)
 * (@cpmstech)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729553)
 * Tobias,
 * We are currently trying to sort by date and it works fine on the back end, but
   as soon as we try to sort it on the front end, it doesn’t sort correctly. It 
   looks like it is sorting by the first number which is in America, the month. 
   Is there a way to have it sort like it is sorting on the back end by the entire
   date taking the day, month, and year into consideration at the same time.
 * Here is a link to our table, if you could take a look at it and tell us what 
   you think, that would be great. Thanks for your time.
 * Another problem that we are having, is the search function on our table isn’t
   searching by dept correctly. E.G., if you were to type in IT, we would hope that
   it would show all the IT departments. Any light that you could shed on this matter
   would be greatly appreciated.
 * [http://researchdevelopment.byu.edu/search-tools/targ-fund-ann](http://researchdevelopment.byu.edu/search-tools/targ-fund-ann)
 * CPMS
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729564)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * [@cpmstech](https://wordpress.org/support/users/cpmstech/): I’ll reply to your
   question in the thread at [http://wordpress.org/support/topic/sorting-tables-by-date](http://wordpress.org/support/topic/sorting-tables-by-date)
   to keep this thread separate.
 * Regards,
    Tobias
 *  [Optima Domains](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729611)
 * I noticed this problem as well when using dollar amounts.
 * For example, sorting from lowest to highest, I get:
 * $9.99
    $9.99 $9.99 $9.59 $9.45 $8.99 $8.99 $8.53 $8.49 $10.69
 * Please advise,
    SB
 * PS. This is one of the most useful plugins for WordPress by far. Thank you!
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729612)
 * Hi,
 * thanks for your post, and sorry for the trouble.
 * Yes, dollar amounts are also strings and not numbers.
    To change this, please
   use this TablePress Extension: [http://tablepress.org/extensions/datatables-sorting-plugins/](http://tablepress.org/extensions/datatables-sorting-plugins/)
 * Regards,
    Tobias
 *  [Optima Domains](https://wordpress.org/support/users/sbwebmaster/)
 * (@sbwebmaster)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729613)
 * Hi Tobias,
 * That did the trick. Continue your great work!
 * Best,
    SB
 *  Plugin Author [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * (@tobiasbg)
 * [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729614)
 * Hi,
 * no problem, you are very welcome! 🙂 Good to hear that this helped!
 * Best wishes,
    Tobias
 * P.S.: In case you haven’t, please [rate TablePress](http://wordpress.org/support/view/plugin-reviews/tablepress)
   here in the plugin directory. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Numerical ordering’ is closed to new replies.

 * ![](https://ps.w.org/tablepress/assets/icon.svg?rev=3192944)
 * [TablePress - Tables in WordPress made easy](https://wordpress.org/plugins/tablepress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/tablepress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/tablepress/)
 * [Active Topics](https://wordpress.org/support/plugin/tablepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/tablepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/tablepress/reviews/)

 * 8 replies
 * 4 participants
 * Last reply from: [Tobias Bäthge](https://wordpress.org/support/users/tobiasbg/)
 * Last activity: [12 years, 2 months ago](https://wordpress.org/support/topic/numerical-ordering/#post-4729614)
 * Status: resolved