Title: Sort by Numerically
Last modified: August 22, 2016

---

# Sort by Numerically

 *  Resolved [apollog](https://wordpress.org/support/users/apollog/)
 * (@apollog)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/sort-by-numerically/)
 * Listings sort alphabetically, but apparently not numerically. Is there a work-
   around or fix for this or is this in the works for a future version? The form
   fields we are using are mostly price (numbers), so sort by does not work.
 * [https://wordpress.org/plugins/business-directory-plugin/](https://wordpress.org/plugins/business-directory-plugin/)

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

 *  Plugin Author [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/sort-by-numerically/#post-5568292)
 * Hi apollog,
 * You’re correct–the plugin uses strings for most fields, and strings are sorted
   in alphabetical order. The only way to get numeric sorting is to use a number-
   based field for the data. What field settings are you using for the Price field
   right now? A screenshot would help.
 *  Thread Starter [apollog](https://wordpress.org/support/users/apollog/)
 * (@apollog)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/sort-by-numerically/#post-5568306)
 * The directory that I am trying to sort is: [http://olssandbox.com/gateway/business-directory/](http://olssandbox.com/gateway/business-directory/)
 * Currently the price-related fields are set up as Post metadata / Textfield / 
   No Validation (so I can add $ symbols when necessary).
 * I have tried using Whole Number Validation, but that does not work when sorting
   either.
 * In a perfect world, I could use a $ in the field and still have it sort numerically,
   but I am a long way from that working.
 *  Plugin Author [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * (@businessdirectoryplugin)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/sort-by-numerically/#post-5568387)
 * Hi apollog,
 * Once you add a string like $ to a field, it automatically can’t be sorted numerically.
   It has to be processed like a string. In an ideal world, we would have a price
   field that stored the data as a number (decimal) and the currency as a string
   separately and did the sorting that way. But BD doesn’t have support for that
   right now. String (lexical) sort is all we have at the moment. Sorry.

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

The topic ‘Sort by Numerically’ is closed to new replies.

 * ![](https://ps.w.org/business-directory-plugin/assets/icon-256x256.png?rev=2901888)
 * [Business Directory Plugin - Easy Listing Directories for WordPress](https://wordpress.org/plugins/business-directory-plugin/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/business-directory-plugin/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/business-directory-plugin/)
 * [Active Topics](https://wordpress.org/support/plugin/business-directory-plugin/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/business-directory-plugin/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/business-directory-plugin/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Business Directory Plugin](https://wordpress.org/support/users/businessdirectoryplugin/)
 * Last activity: [11 years, 5 months ago](https://wordpress.org/support/topic/sort-by-numerically/#post-5568387)
 * Status: resolved