This is a documentation subpage for Template:Number table sorting. It may contain usage information, categories and other content that is not part of the original template page. |
This template is used on approximately 38,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them.
Preview message: Transclusion count updated automatically (see documentation). |
This template uses Lua: |
Note. Adding data-sort-type="number" to the relevant column header solves many numerical sorting problems. See Help:Sortable tables § Forcing a column to have a particular data type. |
This template can be useful when building a sortable table in which a column contains both numbers and text. This template should be applied to every number in the column and should not be used outside of sortable tables.
Currently, the template works for numbers between −10308 and 10308. Numbers outside this range will sort above or below other numbers depending on sign. See the Limitations section below.
By default the output is displayed using thousands separators. To display numbers as entered, use |format=no
.
The template generates a hidden "sort key" in the HTML markup which forces the JavaScript sorting algorithm to sort the column alphabetically.