Changes

6 bytes removed ,  11:14, 6 June 2007
Line 10: Line 10:  
**order: numeric, ignoring these symbols and all ordinary letters and commas, but not spaces; note that scientific notation cannot be used, as e and E are removed
 
**order: numeric, ignoring these symbols and all ordinary letters and commas, but not spaces; note that scientific notation cannot be used, as e and E are removed
 
*numeric
 
*numeric
**criterion: the first non-blank element consists of just digits, points, commas, spaces, "+", "-", possibly followed by "e" or "E" and a string consisting of "+",  "-", digits, possibly followed by "×10" and a string consisting of "+",  "-", digits (the latter is for the purpose of using hidden {{mlw|Scientific_notation|E_notation|e-notation}} followed by visible superscript notation of {{mlw|scientific notation||scientific notation}}); or the element ends with "sm=n" (without the quotes; it stands for "sort mode = numeric"). (In  hidden form this can conveniently be done with {{tim|smn}}.)
+
**criterion: the first non-blank element consists of just digits, points, commas, spaces, "+", "-", possibly followed by "e" or "E" and a string consisting of "+",  "-", digits, possibly followed by "×10" and a string consisting of "+",  "-", digits (the latter is for the purpose of using hidden {{ml|Scientific_notation|E_notation|e-notation}} followed by visible superscript notation of {{ml|scientific notation||scientific notation}}); or the element ends with "sm=n" (without the quotes; it stands for "sort mode = numeric"). (In  hidden form this can conveniently be done with {{tim|smn}}.)
**order: if the string starts with a number (where spaces and nbsp's at the start are ignored) the order is numeric according to the first number in the string ([http://www.devguru.com/technologies/ecmascript/QuickRef/parsefloat.html parseFloat] is applied) after removing the commas, if any; if it does not (parseFloat returns [[w:NaN|NaN]]), the element is positioned like 0
+
**order: if the string starts with a number (where spaces and nbsp's at the start are ignored) the order is numeric according to the first number in the string ([http://www.devguru.com/technologies/ecmascript/QuickRef/parsefloat.html parseFloat] is applied) after removing the commas, if any; if it does not (parseFloat returns [[NaN|NaN]]), the element is positioned like 0
 
:::''proposed internationalisation: in German etc., treat comma as a decimal point''
 
:::''proposed internationalisation: in German etc., treat comma as a decimal point''
 
*string
 
*string
Line 380: Line 380:  
The fourth example shows again that "ca. 12" sorts at 0, as opposed to 12 with some text after it, which sorts at 12. In the latter case an invisible "sm=n" needs to be put at the end, in case such an element arrives at the top of a column, which would otherwise cause alphabetic sorting mode.
 
The fourth example shows again that "ca. 12" sorts at 0, as opposed to 12 with some text after it, which sorts at 12. In the latter case an invisible "sm=n" needs to be put at the end, in case such an element arrives at the top of a column, which would otherwise cause alphabetic sorting mode.
   −
Sortable version of {{mlw|Table:Climate in Middle East cities}}, using smn to specify numeric sort mode:
+
Sortable version of {{ml|Table:Climate in Middle East cities}}, using smn to specify numeric sort mode:
 
{| class="wikitable sortable" style="margin-left:.6em;float:right;"
 
{| class="wikitable sortable" style="margin-left:.6em;float:right;"
 
|-
 
|-
Line 829: Line 829:     
==Secondary sortkey==
 
==Secondary sortkey==
If a column contains a value multiple times then sorting the column preserves the order of the rows within each subset that has the same value in that column ({{mlw|Sorting_algorithm|Stability|stable sorting}}). Thus sorting based on a primary, secondary, tertiary, etc. sortkey can be done by sorting the least-significant sortkey first, etc.
+
If a column contains a value multiple times then sorting the column preserves the order of the rows within each subset that has the same value in that column ({{ml|Sorting_algorithm|Stability|stable sorting}}). Thus sorting based on a primary, secondary, tertiary, etc. sortkey can be done by sorting the least-significant sortkey first, etc.
    
'''First click on column Alphabet and then on Numbers, you'll see that the ordering is on Numbers (1), Alphabet (2).'''
 
'''First click on column Alphabet and then on Numbers, you'll see that the ordering is on Numbers (1), Alphabet (2).'''
2,646

edits