قالب:Numkey2/doc

Use

This template creates an invisible sort key prefix based upon a real number or one of several mathematical symbols for use in sortable tables with mixed numbers and text or merely text. This template creates a valid sort key with an accuracy of one part in 10,000,000,000 for real numbers in the ranges 1e-300 to 1e300 and -1e-300 to -1e300. If the absolute value of the real number is greater than 1e300, this template creates a key representing infinity. If the absolute value of the real number is greater than 0 but less than 1e-300, this template creates a key representing infinitesimal. If the input variable is not a real number, this template does not create a key.

The syntax of this template is:

{{numkey2|var1}}

where var1 is any real number (may contain thousands separators), ∞, 1/∞, -1/∞, -∞, INF, 1/INF, -1/INF, -INF, IND, indeterminate, UND, undefined, UNK, unknown, NA, not applicable, or not available.

The use of this template is illustrated in the sortable table below:

Wikitext Invisible sort key prefix sort without key sort with key
{{numkey2|0}}zero <span style="display:none">!F </span> zero zero
{{numkey2|1}}one <span style="display:none">!C </span> one one
{{numkey2|+2}}+2 <span style="display:none">!B9993068528194 </span> +2 +2
{{numkey2|-3}}-3 <span style="display:none">!J0010986122886 </span> -3 -3
{{numkey2|-4.01267}}-4.01267 <span style="display:none">!J0013894568551 </span> -4.01267 -4.01267
{{numkey2|5.125}}5.125&nbsp;amperes <span style="display:none">!B9983658694749 </span> 5.125 amperes 5.125 amperes
{{numkey2|{{#expr:2*pi}}}}2&pi; <span style="display:none">!B9981621229335 </span>
{{numkey2|7}}VII <span style="display:none">!B9980540898509 </span> VII VII
{{numkey2|8.27}}£8.27 <span style="display:none">!B9978873654909 </span> £8.27 £8.27
{{numkey2|-9.000}}-9.000 <span style="display:none">!J0021972245773 </span> -9.000 -9.000
{{numkey2|10}}10 apples <span style="display:none">!B9976974149070 </span> 10 apples 10 apples
{{numkey2|1776}}MDCCLXXVI <span style="display:none">!B9925178810764 </span> MDCCLXXVI MDCCLXXVI
{{numkey2|10000000000}}10,000,000,000 <span style="display:none">!B9769741490700 </span> 10,000,000,000 10,000,000,000
{{numkey2|10000000001}}10,000,000,001 <span style="display:none">!B9769741490699 </span> 10,000,000,001 10,000,000,001
{{numkey2|12046360889000}}$12,046,360,889,000 <span style="display:none">!B9698802162706 </span> $12,046,360,889,000 $12,046,360,889,000
{{numkey2|1e100}}googol <span style="display:none">!B7697414907005 </span> googol googol
{{numkey2|-1}}minus one <span style="display:none">!I </span> minus one minus one
{{numkey2|0.25}}$0.25 <span style="display:none">!D0013862943611 </span> $0.25 $0.25
{{numkey2|-0.035}}-0.035 <span style="display:none">!H9966475927825 </span> -0.035 -0.035
{{numkey2|-1.4525e-9}}-1.4525e-9&nbsp;m <span style="display:none">!H9796500203727 </span> -1.4525e-9 m -1.4525e-9 m
{{numkey2|1e-300}}googol<sup>-3</sup> <span style="display:none">!D6907755278982 </span> googol-3 googol-3
{{numkey2|-1e300}}-googol<sup>3</sup> <span style="display:none">!J6907755278982 </span> -googol3 -googol3
{{numkey2|1e301}}1e301 <span style="display:none">!A </span> 1e301 1e301
{{numkey2|1e-302}}1e-302 <span style="display:none">!E </span> 1e-302 1e-302
{{numkey2|-1e303}}-1e303 <span style="display:none">!K </span> -1e303 -1e303
{{numkey2|-1e-304}}-1e-304 <span style="display:none">!G </span> -1e-304 -1e-304
{{numkey2|not a number}}AAA AAA AAA
{{numkey2}}ZZZ ZZZ ZZZ

See also