Last modified: 2013-12-13 19:50:00 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T60443, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 58443 - Tablesorter should sort non-numerical values alphabeticaly ("natural sorting")
Tablesorter should sort non-numerical values alphabeticaly ("natural sorting")
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.23.0
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 31601
  Show dependency treegraph
 
Reported: 2013-12-13 10:22 UTC by Michael M.
Modified: 2013-12-13 19:50 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Michael M. 2013-12-13 10:22:06 UTC
Example:

{| class="wikitable sortable"
|-
! data-sort-type="number" | Number of foos
|-
| 2
|-
| unknown
|-
| 5
|-
| N/A
|-
| 1
|-
| 0
|-
| N/A
|-
| unknown
|}

This currently sorts as:

unknown
N/A
0
N/A
unknown
1
2
5

while the expected order is

N/A
N/A
unknown
unknown
0
1
2
5

I.e: When the sort type is numerical, the function used for comparison should sort
* two numbers according to their value
* any number (including 0 and negative numbers) after any non-number
* two non-numbers according to their position in alphabet
Comment 1 Bartosz Dziewoński 2013-12-13 19:50:00 UTC
I'm pretty sure what you described is called "natural sorting" (identifying runs of digits and non-digits and sorting them separately – 
http://www.codinghorror.com/blog/2007/12/sorting-for-humans-natural-sort-order.html), and something I would love to implement some day.

(Somewhat related: bug 45161.)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links