Support

Search results for ""

Sorry, no results found. Perhaps you would like to search the documentation?
All Topics
Thomas

Sorting off when using big and small numbers

Hi there,

It seems column sorting has problems with post fields that can provide big or small numbers.

Sorting examples:

100 – 30 – 40 – 50 – … (order off, 100 displayed before smaller number)

vs.

90 – 30 – 40 – 50 – … (order correct)

Cheers,
Thomas

4 years, 10 months ago
Stefan
Developer

Hi Thomas,

Can you tell us more about the setting of your column?
Based on your description I guess that you use a custom field column with field type set to default.
Since we expect that the value is a string, sorting is done alphabetical, and thus 1 is lower than 3.
When you’re sure the value is always a number, you can set the field type to ‘numeric’ and sorting should be working as expected. Although your second example is not sorted as expected ;)

4 years, 10 months ago
Thomas

I think the numeric option solved it, thanks!

4 years, 10 months ago
Stefan
Developer

Great, I did kind of expect it to be :)

4 years, 10 months ago

You must be logged in to reply to this topic.