Sjabloon:Numkey
[bewerken] [ ] Template documentation
Use
This template creates an invisible sort key prefix based upon a real number 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 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 for this template is:
{{numkey|var1}}
where:
- var1 = any real number
- NOTE: var1 may not contain thousands separators
The use of this template is illustrated below:
Wikitext | Invisible sort key prefix | sort without key | sort with key |
---|---|---|---|
{{numkey|0}}zero | <span style="display:none">!F </span> | zero | zero |
{{numkey|1}}one | <span style="display:none">!C </span> | one | one |
{{numkey|+2}}+2 | <span style="display:none">!B9993068528194 </span> | +2 | +2 |
{{numkey|-3}}-3 | <span style="display:none">!J0010986122886 </span> | -3 | -3 |
{{numkey|-4.01267}}-4.01267 | <span style="display:none">!J0013894568551 </span> | -4.01267 | -4.01267 |
{{numkey|5.125}}5.125 amperes | <span style="display:none">!B9983658694749 </span> | 5.125 amperes | 5.125 amperes |
{{numkey|{{#expr:2*pi}}}}2π | <span style="display:none">!B9981621229335 </span> | 2π | 2π |
{{numkey|7}}VII | <span style="display:none">!B9980540898509 </span> | VII | VII |
{{numkey|8.27}}£8.27 | <span style="display:none">!B9978873654909 </span> | £8.27 | £8.27 |
{{numkey|-9.000}}-9.000 | <span style="display:none">!J0021972245773 </span> | -9.000 | -9.000 |
{{numkey|10}}10 apples | <span style="display:none">!B9976974149070 </span> | 10 apples | 10 apples |
{{numkey|1776}}MDCCLXXVI | <span style="display:none">!B9925178810764 </span> | MDCCLXXVI | MDCCLXXVI |
{{numkey|10000000000}}10,000,000,000 | <span style="display:none">!B9769741490700 </span> | 10,000,000,000 | 10,000,000,000 |
{{numkey|10000000001}}10,000,000,001 | <span style="display:none">!B9769741490699 </span> | 10,000,000,001 | 10,000,000,001 |
{{numkey|12046360889000}}$12,046,360,889,000 | <span style="display:none">!B9698802162706 </span> | $12,046,360,889,000 | $12,046,360,889,000 |
{{numkey|1e100}}googol | <span style="display:none">!B7697414907005 </span> | googol | googol |
{{numkey|-1}}minus one | <span style="display:none">!I </span> | minus one | minus one |
{{numkey|0.25}}$0.25 | <span style="display:none">!D0013862943611 </span> | $0.25 | $0.25 |
{{numkey|-0.035}}-0.035 | <span style="display:none">!H9966475927825 </span> | -0.035 | -0.035 |
{{numkey|-1.4525e-9}}-1.4525e-9 m | <span style="display:none">!H9796500203727 </span> | -1.4525e-9 m | -1.4525e-9 m |
{{numkey|1e-300}}googol<sup>-3</sup> | <span style="display:none">!D6907755278982 </span> | googol-3 | googol-3 |
{{numkey|-1e300}}-googol<sup>3</sup> | <span style="display:none">!J6907755278982 </span> | -googol3 | -googol3 |
{{numkey|1e301}}1e301 | <span style="display:none">!A </span> | 1e301 | 1e301 |
{{numkey|1e-302}}1e-302 | <span style="display:none">!E </span> | 1e-302 | 1e-302 |
{{numkey|-1e303}}-1e303 | <span style="display:none">!K </span> | -1e303 | -1e303 |
{{numkey|-1e-304}}-1e-304 | <span style="display:none">!G </span> | -1e-304 | -1e-304 |
{{numkey|not a number}}AAA | AAA | AAA | |
{{numkey}}ZZZ | ZZZ | ZZZ |
See also
- This template invokes Template:Hid.
- Template:Numkey2 invokes this template and provides additional functionality.
The above documentation is transcluded from Sjabloon:Numkey/doc. (edit | history) Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |