Template:Convert/doc/parameter list: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>DePiep
No edit summary
Ookami (talk | contribs)
m 83 revisions imported
 
(50 intermediate revisions by 11 users not shown)
Line 2: Line 2:
! colspan=4 style="background:#eee" | {{navbar-collapsible|'''Parameter options for <nowiki>{{convert}}</nowiki>'''|Convert/doc/parameter list}}
! colspan=4 style="background:#eee" | {{navbar-collapsible|'''Parameter options for <nowiki>{{convert}}</nowiki>'''|Convert/doc/parameter list}}
|-
|-
! Option
! Parameter
! {{abbr|1==..|2=Sort by value of the option}}
! Value
! Description
! Description
! Note
! Note
|-
|-
|<code>&#124;abbr=in</code> || {{hidden sort key|in}} || Use symbol for first (left-hand side) unit || Symbol ('abbreviation')
| rowspan=15 | <code>&#124;abbr</code>
| data-sort-value="in" | <code>in</code>
| Use symbol for first (left-hand side) unit
| Unit display
|-
|-
|<code>&#124;abbr=off</code> || {{hidden sort key|off}}
| data-sort-value="off" | <code>off</code>
| rowspan=2 | Use name for all units
| rowspan=2 | Use name for all units
| rowspan=2 | Symbol ('abbreviation')
| rowspan=2 | Unit display
|-
|-
|<code>&#124;abbr=none</code> || {{hidden sort key|none}}
| data-sort-value="none" | <code>none</code>
|-
|-
|<code>&#124;abbr=on</code> || {{hidden sort key|on}} || Use symbol for all units || Symbol ('abbreviation')
| data-sort-value="on" | <code>on</code>
| Use symbol for all units
| Unit display
|-
|-
|<code>&#124;abbr=out</code> || {{hidden sort key|out}} || Use symbol for right-hand side unit (default) || Symbol ('abbreviation')
| data-sort-value="out" | <code>out</code>
| Use symbol for right-hand side unit (default)
| Unit display
|-
|-
|<code>&#124;abbr=values</code> || {{hidden sort key|values}} || Show only input and output numbers, not units || Parts only
| data-sort-value="unit" | <code>unit</code>
| Use symbol for all units when using scientific notation
| Unit display
|-
|-
|<code>&#124;adj=1</code> || {{hidden sort key|01}} || Unit name is singular when value is 1 or less, but not zero || Grammar, plural
| data-sort-value="values" | <code>values</code>
| Omit both the input and output units: show only the numbers
| Unit display
|-
|-
|<code>&#124;adj=j</code> || {{hidden sort key|j}} || Join value and unit name using "&amp;nbsp;" instead of a space || Join values
| data-sort-value="~" | <code>~</code>
| Shows both unit name and symbol
| Unit display
|-
|-
|<code>&#124;adj=mid</code> || {{hidden sort key|mid}} || Same as <code>adj=on</code> with user-specified text after input unit || Word adding, adjective
| data-sort-value="mid" | <code>mid</code>
| User-specified text after the input unit; sets <code>adj=on</code> (adjective). Expects 1 unnamed parameter.
| Word adding, adjective
|-
|-
|<code>&#124;adj=on</code> || {{hidden sort key|on}} || Unit name is singular and hyphenated (adjective) || Grammar, adjective
| data-sort-value="on" | <code>on</code>
| Unit name is adjective (singular and hyphenated)
| Grammar, adjective
|-
|-
|<code>&#124;adj=pre</code> || {{hidden sort key|pre}} || User-specified text before input unit || Word adding
| data-sort-value="pre" | <code>pre</code>
| User-specified text before input unit. Expects 1 unnamed parameter.
| Word adding
|-
|-
|<code>&#124;adj=ri0</code> || {{hidden sort key|ri0}} || Round input with precision 0 || Rounding and sigfig
| data-sort-value="ri0" | <code>ri0</code>
| Round input with precision 0
| Input precision
|-
|-
|<code>&#124;adj=ri1</code> || {{hidden sort key|ri1}} || Round input with precision 1 || Rounding and sigfig
| data-sort-value="ri1" | <code>ri1</code>
| Round input with precision 1
| Input precision
|-
|-
|<code>&#124;adj=ri2</code> || {{hidden sort key|ri2}} || Round input with precision 2 || Rounding and sigfig
| data-sort-value="ri2" | <code>ri2</code>
| Round input with precision 2
| Input precision
|-
|-
|<code>&#124;adj=ri3</code> || {{hidden sort key|ri3}} || Round input with precision 3 || Rounding and sigfig
| data-sort-value="ri3" | <code>ri3</code>
| Round input with precision 3
| Input precision
|-
|-
|<code>&#124;disp=b</code> || {{hidden sort key|b}} || Join input and output using "&nbsp;(...)" (default) || Join values
| rowspan=3 | <code>&#124;comma</code>
| data-sort-value="05" | <code>5</code>
| Only use comma for thousands separator if 5 or more digits
| Number format
|-
| data-sort-value="gaps" | <code>gaps</code>
| Use gaps (space), not comma, for thousands separator
| Number format
|-
|-
|<code>&#124;disp=sqbr</code> || {{hidden sort key|sqbr}} || Join input and output using "&nbsp;[...]" || Join values
| data-sort-value="off" | <code>off</code>
| No thousands separator
| Number format
|-
|-
|<code>&#124;disp=br</code> || {{hidden sort key|br}} || Join input and output using "&lt;br/>" || Join values
| rowspan=15 | <code>&#124;disp</code>
| data-sort-value="b" | <code>b</code>
| Join input and output using "&nbsp;(...)" (default)
| Join values
|-
|-
|<code>&#124;disp=comma</code> || {{hidden sort key|comma}} || Join input and output using ",&nbsp;" || Join values
| data-sort-value="sqbr" | <code>sqbr</code>
| Join input and output using "&nbsp;[...]"
| Join values
|-
|-
|<code>&#124;disp=or</code> || {{hidden sort key|or}} || Join input and output using "&nbsp;or&nbsp;" || Join values
| data-sort-value="br" | <code>br</code>
| Join input and output using "&lt;br/>"
| Join values
|-
|-
|<code>&#124;disp=number</code> || {{hidden sort key|number}}
| data-sort-value="comma" | <code>comma</code>
| rowspan=2 | Display output value only
| Join input and output using ",&nbsp;"
| rowspan=2 | Parts only
| Join values
|-
|-
|<code>&#124;disp=output number only</code> || {{hidden sort key|output number only}}
| data-sort-value="or" | <code>or</code>
| Join input and output using "&nbsp;or&nbsp;"
| Join values
|-
|-
|<code>&#124;disp=out</code> || {{hidden sort key|out}}
| data-sort-value="number" | <code>number</code>
| rowspan=2 | Display only output value and name/symbol
| rowspan=2 | Display output number only
| rowspan=2 | Parts only
| rowspan=2 | Parts only
|-
|-
|<code>&#124;disp=output only</code> || {{hidden sort key|output only}}
| data-sort-value="output number only" | <code>output number only</code>
|-
|-
|<code>&#124;disp=preunit</code> || {{hidden sort key|preunit}} || User-specified text before input and output units || Word adding
| data-sort-value="out" | <code>out</code>
| rowspan=2 | Display only output number and name/symbol
| rowspan=2 | Parts only
|-
|-
|<code>&#124;disp=table</code> || {{hidden sort key|table}} || Output is suitable for a table cell with align="right" || Table columns
| data-sort-value="output only" | <code>output only</code>
|-
|-
|<code>&#124;disp=tablecen</code> || {{hidden sort key|tablecen}} || Output is suitable for a table cell with align="center" || Table columns
| data-sort-value="preunit" | <code>preunit</code>
| Text to be inserted after value and before units, for both input and output, with optionally different text for output.  Expects 1 or 2 unnamed parameters.
| Word adding
|-
|-
|<code>&#124;disp=unit</code> || {{hidden sort key|unit}} || Display input name/symbol only (not output; not input value) || Parts only
| data-sort-value="table" | <code>table</code>
| Output is suitable for a table cell with align="right"
| Table columns
|-
|-
|<code>&#124;disp=unit2</code> || {{hidden sort key|unit2}}
| data-sort-value="tablecen" | <code>tablecen</code>
| Display output name/symbol only (not input; not output value) || Parts only
| Output is suitable for a table cell with align="center"
| Table columns
|-
|-
|<code>&#124;disp=x&#124;...</code> || {{hidden sort key|x}} || Join input and output using user-specified text || Word adding
| data-sort-value="unit" | <code>unit</code>
| Display input name/symbol only (not input number, not output)
| Parts only
|-
|-
|<code>&#124;comma=5</code> || {{hidden sort key|05}} || Only use comma for thousands separator if 5 or more digits || Number format
| data-sort-value="unit2" | <code>unit2</code>
| Display output name/symbol only (not input; not output number)
| Parts only
|-
|-
|<code>&#124;comma=gaps</code> || {{hidden sort key|gaps}} || Use gaps (space), not comma, for thousands separator || Number format
| data-sort-value="x" | <code>x</code>
| Join input and output using user-specified text
| Word adding
|-
|-
|<code>&#124;comma=gaps5</code> || {{hidden sort key|gaps5}} || Use gaps (space), but only if 5 or more digits || Number format
| <code>&#124;frac</code>
| data-sort-value="N" | <code>''N''</code>
| Show imperial number in fractions, denominator=''N''
| Number format, fraction
|-
|-
|<code>&#124;comma=off</code> || {{hidden sort key|off}} || No thousands separator || Number format
| <code>&#124;input</code>
| data-sort-value="property P2048" | <code>P2048</code> {{small|1=(e.g.)}}
| Reads and converts Wikidata property
| Inside template
|-
|-
|<code>&#124;frac=''N''</code> || {{hidden sort key|N}} || Show imperial number in fractions, denominator=''N'' || Number format, fraction
| rowspan=3 | <code>&#124;lk</code>
| data-sort-value="in" | <code>in</code>
| Link left-hand side unit name or symbol
| Unit link
|-
|-
|<code>&#124;lk=in</code> || {{hidden sort key|in}} || Link left-hand side unit name or symbol || Unit link
| data-sort-value="on" | <code>on</code>
| Link all unit names or symbols (but not twice for the same unit)
| Unit link
|-
|-
|<code>&#124;lk=on</code> || {{hidden sort key|on}} || Link all unit names or symbols (but not twice for the same unit) || Unit link
| data-sort-value="out" | <code>out</code>
| Link right-hand side unit name or symbol
| Unit link
|-
|-
|<code>&#124;lk=out</code> || {{hidden sort key|out}} || Link right-hand side unit name or symbol || Unit link
| rowspan=2 | <code>&#124;order</code>
| data-sort-value="flip" | <code>flip</code>
| Inverts order of input, output measurements (conversion first)
| Order
|-
|-
|<code>&#124;order=flip</code> || {{hidden sort key|flip}} || Inverts order of input, output measurements (conversion first) || Order
| data-sort-value="out" | <code>out</code>
| Displays output units in the order entered, skipping input unit
| Order
|-
|-
|<code>&#124;round=5</code> || {{hidden sort key|05}} || Rounds calculation to the nearest multiple of 5 || Rounding and sigfig
| <code>&#124;qid</code>
| data-sort-value="qid Q1056131" | <code>Q1056131</code> {{small|1=(e.g.)}}
| Reads Wikidata property from Wikidata item
| Inside template; testing
|-
|-
|<code>&#124;round=25</code> || {{hidden sort key|25}} || Rounds calculation to the nearest multiple of 25 || Rounding and sigfig
| <code>&#124;qual</code>
| data-sort-value="qual Q613628" | <code>Q613628</code> {{small|1=(e.g.)}}
| Qualify Wikidata property
|  
|-
|-
|<code>&#124;round=each</code> || {{hidden sort key|each}} || In a range, each value is rounded by the default rounding || Rounding and sigfig
| rowspan=3 | <code>&#124;round</code>
| data-sort-value="05" | <code>5</code>
| Rounds calculation to the nearest multiple of 5
| Output precision
|-
|-
|<code>&#124;sigfig=''N''</code> || {{hidden sort key|N}} || Round output value to ''N'' significant figures (''N'' is a positive integer) || Rounding and sigfig
| data-sort-value="25" | <code>25</code>
| Rounds calculation to the nearest multiple of 25
| Output precision
|-
|-
|<code>&#124;sortable=in</code> || {{hidden sort key|in}}
| data-sort-value="each" | <code>each</code>
| rowspan=2 | Output numeric hidden sort field for use in a sortable table (based on input)
| In a range, each number is rounded by the default rounding
| rowspan=2 | Table sort
| Output precision
|-
|-
|<code>&#124;sortable=on</code> || {{hidden sort key|on}}
| <code>&#124;sigfig</code>
| data-sort-value="N" | <code>''N''</code>
| Round output number to ''N'' significant figures (''N'' is a positive integer)
| Output precision
|-
|-
|<code>&#124;sortable=out</code> || {{hidden sort key|out}}
| <code>&#124;sortable</code>
| Output numeric hidden sort field for use in a sortable table (based on output)
| data-sort-value="on" | <code>on</code>
| Adds invisible sort key
| Table sort
| Table sort
|-
|-
|<code>&#124;sp=us</code> || {{hidden sort key|us}}
| <code>&#124;sp</code>
| Use U.S. spelling (like "meter" instead of default "metre")
| data-sort-value="us" | <code>us</code>
| Spelling
| Use U.S. spelling ("meter" instead of default "metre")
| Spelling U.S.&nbsp;names
|-
|-
|<code>&#124;spell=in</code> || {{hidden sort key|in}}
| rowspan=4 | <code>&#124;spell</code>
| Spell input value in words
| data-sort-value="in" | <code>in</code>
| Number spelling
| Spell input number in words
| Spelling numbers
|-
|-
|<code>&#124;spell=In</code> || {{hidden sort key|In}}
| data-sort-value="In" | <code>In</code>
| Spell input value in words with first letter uppercase
| Spell input number in words with first letter uppercase
| Number spelling
| Spelling numbers
|-
|-
|<code>&#124;spell=on</code> || {{hidden sort key|on}}
| data-sort-value="on" | <code>on</code>
| Spell input and output values in words
| Spell input and output numbers in words
| Number spelling
| Spelling numbers
|-
|-
|<code>&#124;spell=On</code> || {{hidden sort key|On}}
| data-sort-value="On" | <code>On</code>
| Spell input and output values in words with first letter uppercase
| Spell input and output numbers in words with first letter uppercase
| Number spelling
| Spelling numbers
|-
|-
|<code>&#124;$=&euro;</code> || {{hidden sort key|$}}
| <code>&#124;$</code>
| Replace $-sign with other currency sing, for example in <code>$/acre</code>{{nowrap|(no currency conversion)}}
| data-sort-value="&euro;" | <code>&euro;</code>
| Replace $-sign with a currency sign, for example in <code>$/acre</code> {{nowrap|(no currency conversion happens)}}
| Cost per unit
| Cost per unit
|-
|-
|<code>&#124;debug=yes</code> || {{hidden sort key|yes}}
| <code>&#124;debug</code>
| data-sort-value="yes" | <code>yes</code>
| '''Debugging only'''. In a sortable table: show the normally hidden sort key
| '''Debugging only'''. In a sortable table: show the normally hidden sort key
| Table sort
| Table sort
|-
|- <!-- ----------------- Deprecated options ------------------------- -->
|<code>{{!xt|1=&#124;abbr=comma}}</code> || {{hidden sort key|comma}}
| <code>{{!mxt|1=&#124;disp}}</code> || data-sort-value="flip" | <code>flip</code>
| '''Deprecated'''. Use {{xt|1=&#x7c;comma=off}}
| '''Deprecated'''. Use {{mxt|1=&#x7c;order=flip}}
| Number format
|-
|<code>{{!xt|1=&#124;abbr=mos}}</code> || {{hidden sort key|mos}}
| '''Deprecated'''. Use {{xt|1=&#x7c;x&#x7c;}} ''or'' {{xt|1=&#x7c;by&#x7c;}}
| Range format
|-
|<code>{{!xt|1=&#124;adj=flip}}</code> || {{hidden sort key|flip}}
| '''Deprecated'''. Use {{xt|1=&#x7c;order=flip}}
| Order
| Order
|-
|-
| <code>{{!xt|1=&#124;adj=nocomma}}</code> || {{hidden sort key|nocomma}}
|<code>{{!mxt|1=&#124;sing=}}</code> || data-sort-value="" |  
| '''Deprecated'''. Use {{xt|1=&#x7c;comma=off}}
| '''Deprecated'''. Use {{mxt|1=&#x7c;adj=}}
| Number format
| Plurals
|-
 
|<code>{{!xt|1=&#124;disp=2}}</code> || {{hidden sort key|02}}
|}
| '''Deprecated'''. Use {{xt|1=&#x7c;disp=output only}}
| Parts only
|-
|<code>{{!xt|1=&#124;disp=5}}</code> || {{hidden sort key|05}}
| '''Deprecated'''. Use {{xt|1=&#x7c;round=5}}
| Rounding and sigfig
|-
|<code>{{!xt|1=&#124;disp=flip}}</code> || {{hidden sort key|flip}}
| '''Deprecated'''. Use {{xt|1=&#x7c;order=flip}}
| Order
|-
|<code>{{!xt|1=&#124;disp=flip5}}</code> || {{hidden sort key|flip5}}
| '''Deprecated'''. Use {{xt|1=&#x7c;order=flip&nbsp;&#x7c;round=5}}
| Order, rounding
|-
| <code>{{!xt|1=&#124;disp=nocomma}}</code> || {{hidden sort key|nocomma}}
| '''Deprecated'''. Use {{xt|1=&#x7c;comma=off}}
| Number format
|-
|<code>{{!xt|1=&#124;disp=u2}}</code> || {{hidden sort key|u2}}
| '''Deprecated'''. Use {{xt|1=&#x7c;disp=unit2}}
| Parts only
|-
|<code>{{!xt|1=&#124;near=5}}</code> || {{hidden sort key|05}}
| '''Deprecated'''. Use {{xt|1=&#x7c;round=5}}
| Rounding and sigfig
|}<noinclude>
{{documentation}}
</noinclude>

Latest revision as of 01:06, 3 September 2020

Parameter Value Description Note
|abbr in Use symbol for first (left-hand side) unit Unit display
off Use name for all units Unit display
none
on Use symbol for all units Unit display
out Use symbol for right-hand side unit (default) Unit display
unit Use symbol for all units when using scientific notation Unit display
values Omit both the input and output units: show only the numbers Unit display
~ Shows both unit name and symbol Unit display
mid User-specified text after the input unit; sets adj=on (adjective). Expects 1 unnamed parameter. Word adding, adjective
on Unit name is adjective (singular and hyphenated) Grammar, adjective
pre User-specified text before input unit. Expects 1 unnamed parameter. Word adding
ri0 Round input with precision 0 Input precision
ri1 Round input with precision 1 Input precision
ri2 Round input with precision 2 Input precision
ri3 Round input with precision 3 Input precision
|comma 5 Only use comma for thousands separator if 5 or more digits Number format
gaps Use gaps (space), not comma, for thousands separator Number format
off No thousands separator Number format
|disp b Join input and output using " (...)" (default) Join values
sqbr Join input and output using " [...]" Join values
br Join input and output using "<br/>" Join values
comma Join input and output using ", " Join values
or Join input and output using " or " Join values
number Display output number only Parts only
output number only
out Display only output number and name/symbol Parts only
output only
preunit Text to be inserted after value and before units, for both input and output, with optionally different text for output. Expects 1 or 2 unnamed parameters. Word adding
table Output is suitable for a table cell with align="right" Table columns
tablecen Output is suitable for a table cell with align="center" Table columns
unit Display input name/symbol only (not input number, not output) Parts only
unit2 Display output name/symbol only (not input; not output number) Parts only
x Join input and output using user-specified text Word adding
|frac N Show imperial number in fractions, denominator=N Number format, fraction
|input P2048 (e.g.) Reads and converts Wikidata property Inside template
|lk in Link left-hand side unit name or symbol Unit link
on Link all unit names or symbols (but not twice for the same unit) Unit link
out Link right-hand side unit name or symbol Unit link
|order flip Inverts order of input, output measurements (conversion first) Order
out Displays output units in the order entered, skipping input unit Order
|qid Q1056131 (e.g.) Reads Wikidata property from Wikidata item Inside template; testing
|qual Q613628 (e.g.) Qualify Wikidata property
|round 5 Rounds calculation to the nearest multiple of 5 Output precision
25 Rounds calculation to the nearest multiple of 25 Output precision
each In a range, each number is rounded by the default rounding Output precision
|sigfig N Round output number to N significant figures (N is a positive integer) Output precision
|sortable on Adds invisible sort key Table sort
|sp us Use U.S. spelling ("meter" instead of default "metre") Spelling U.S. names
|spell in Spell input number in words Spelling numbers
In Spell input number in words with first letter uppercase Spelling numbers
on Spell input and output numbers in words Spelling numbers
On Spell input and output numbers in words with first letter uppercase Spelling numbers
|$ Replace $-sign with a currency sign, for example in $/acre (no currency conversion happens) Cost per unit
|debug yes Debugging only. In a sortable table: show the normally hidden sort key Table sort
|disp flip Deprecated. Use |order=flip Order
|sing= Deprecated. Use |adj= Plurals