Template:Convert/doc/parameter list: Difference between revisions
From Zoophilia Wiki
< Template:Convert | doc
No edit summary |
m 83 revisions imported |
||
(28 intermediate revisions by 10 users not shown) | |||
Line 3: | Line 3: | ||
|- | |- | ||
! Parameter | ! Parameter | ||
! | ! Value | ||
! Description | ! Description | ||
! Note | ! Note | ||
|- | |- | ||
|<code>|abbr | | rowspan=15 | <code>|abbr</code> | ||
| data-sort-value="in" | <code>in</code> | |||
| Use symbol for first (left-hand side) unit | | Use symbol for first (left-hand side) unit | ||
| | | Unit display | ||
|- | |- | ||
|<code> | | data-sort-value="off" | <code>off</code> | ||
| rowspan=2 | Use name for all units | | rowspan=2 | Use name for all units | ||
| rowspan=2 | | | rowspan=2 | Unit display | ||
|- | |- | ||
|<code> | | data-sort-value="none" | <code>none</code> | ||
|- | |- | ||
|<code> | | data-sort-value="on" | <code>on</code> | ||
| Use symbol for all units | | Use symbol for all units | ||
| | | Unit display | ||
|- | |- | ||
|<code> | | data-sort-value="out" | <code>out</code> | ||
| Use symbol for right-hand side unit (default) | | Use symbol for right-hand side unit (default) | ||
| | | Unit display | ||
|- | |- | ||
|<code> | | data-sort-value="unit" | <code>unit</code> | ||
| | | Use symbol for all units when using scientific notation | ||
| | | Unit display | ||
|- | |||
| data-sort-value="values" | <code>values</code> | |||
| Omit both the input and output units: show only the numbers | |||
| Unit display | |||
|- | |- | ||
|<code> | | data-sort-value="~" | <code>~</code> | ||
| Shows both unit name and symbol | | Shows both unit name and symbol | ||
| | | Unit display | ||
|- | |- | ||
|<code> | | data-sort-value="mid" | <code>mid</code> | ||
| User-specified text after the input unit; sets <code>adj=on</code> (adjective) | | User-specified text after the input unit; sets <code>adj=on</code> (adjective). Expects 1 unnamed parameter. | ||
| Word adding, adjective | | Word adding, adjective | ||
|- | |- | ||
|<code> | | data-sort-value="on" | <code>on</code> | ||
| Unit name is adjective (singular and hyphenated) | | Unit name is adjective (singular and hyphenated) | ||
| Grammar, adjective | | Grammar, adjective | ||
|- | |- | ||
|<code> | | data-sort-value="pre" | <code>pre</code> | ||
| User-specified text before input unit | | User-specified text before input unit. Expects 1 unnamed parameter. | ||
| Word adding | | Word adding | ||
|- | |- | ||
|<code> | | data-sort-value="ri0" | <code>ri0</code> | ||
| Round input with precision 0 | | Round input with precision 0 | ||
| | | Input precision | ||
|- | |- | ||
|<code> | | data-sort-value="ri1" | <code>ri1</code> | ||
| Round input with precision 1 | | Round input with precision 1 | ||
| | | Input precision | ||
|- | |- | ||
|<code> | | data-sort-value="ri2" | <code>ri2</code> | ||
| Round input with precision 2 | | Round input with precision 2 | ||
| | | Input precision | ||
|- | |- | ||
|<code> | | data-sort-value="ri3" | <code>ri3</code> | ||
| Round input with precision 3 | | Round input with precision 3 | ||
| | | Input precision | ||
|- | |||
| rowspan=3 | <code>|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 | |||
|- | |||
| data-sort-value="off" | <code>off</code> | |||
| No thousands separator | |||
| Number format | |||
|- | |- | ||
|<code>|disp | | rowspan=15 | <code>|disp</code> | ||
| data-sort-value="b" | <code>b</code> | |||
| Join input and output using " (...)" (default) | | Join input and output using " (...)" (default) | ||
| Join values | | Join values | ||
|- | |- | ||
|<code> | | data-sort-value="sqbr" | <code>sqbr</code> | ||
| Join input and output using " [...]" | | Join input and output using " [...]" | ||
| Join values | | Join values | ||
|- | |- | ||
|<code> | | data-sort-value="br" | <code>br</code> | ||
| Join input and output using "<br/>" | | Join input and output using "<br/>" | ||
| Join values | | Join values | ||
|- | |- | ||
|<code> | | data-sort-value="comma" | <code>comma</code> | ||
| Join input and output using ", " | | Join input and output using ", " | ||
| Join values | | Join values | ||
|- | |- | ||
|<code> | | data-sort-value="or" | <code>or</code> | ||
| Join input and output using " or " | | Join input and output using " or " | ||
| Join values | | Join values | ||
|- | |- | ||
|<code> | | data-sort-value="number" | <code>number</code> | ||
| rowspan=2 | Display output number only | | rowspan=2 | Display output number only | ||
| rowspan=2 | Parts only | | rowspan=2 | Parts only | ||
|- | |- | ||
|<code> | | data-sort-value="output number only" | <code>output number only</code> | ||
|- | |- | ||
|<code> | | data-sort-value="out" | <code>out</code> | ||
| rowspan=2 | Display only output number and name/symbol | | rowspan=2 | Display only output number and name/symbol | ||
| rowspan=2 | Parts only | | rowspan=2 | Parts only | ||
|- | |- | ||
|<code> | | data-sort-value="output only" | <code>output only</code> | ||
|- | |- | ||
|<code> | | 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. | | 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 | | Word adding | ||
|- | |- | ||
|<code> | | data-sort-value="table" | <code>table</code> | ||
| Output is suitable for a table cell with align="right" | | Output is suitable for a table cell with align="right" | ||
| Table columns | | Table columns | ||
|- | |- | ||
|<code> | | data-sort-value="tablecen" | <code>tablecen</code> | ||
| Output is suitable for a table cell with align="center" | | Output is suitable for a table cell with align="center" | ||
| Table columns | | Table columns | ||
|- | |- | ||
|<code> | | data-sort-value="unit" | <code>unit</code> | ||
| Display input name/symbol only (not input number, not output) | | Display input name/symbol only (not input number, not output) | ||
| Parts only | | Parts only | ||
|- | |- | ||
|<code> | | data-sort-value="unit2" | <code>unit2</code> | ||
| Display output name/symbol only (not input; not output number) | | Display output name/symbol only (not input; not output number) | ||
| Parts only | | Parts only | ||
|- | |- | ||
|<code> | | data-sort-value="x" | <code>x</code> | ||
| Join input and output using user-specified text | | Join input and output using user-specified text | ||
| Word adding | | Word adding | ||
|- | |- | ||
|<code>| | | <code>|frac</code> | ||
| data-sort-value="N" | <code>''N''</code> | |||
|- | |||
| Show imperial number in fractions, denominator=''N'' | | Show imperial number in fractions, denominator=''N'' | ||
| Number format, fraction | | Number format, fraction | ||
|- | |- | ||
|<code>| | | <code>|input</code> | ||
| data-sort-value="property P2048" | <code>P2048</code> {{small|1=(e.g.)}} | |||
| Reads and converts Wikidata property | |||
| Inside template | |||
|- | |||
| rowspan=3 | <code>|lk</code> | |||
| data-sort-value="in" | <code>in</code> | |||
| Link left-hand side unit name or symbol | | Link left-hand side unit name or symbol | ||
| Unit link | | Unit link | ||
|- | |- | ||
|<code> | | data-sort-value="on" | <code>on</code> | ||
| Link all unit names or symbols (but not twice for the same unit) | | Link all unit names or symbols (but not twice for the same unit) | ||
| Unit link | | Unit link | ||
|- | |- | ||
|<code> | | data-sort-value="out" | <code>out</code> | ||
| Link right-hand side unit name or symbol | | Link right-hand side unit name or symbol | ||
| Unit link | | Unit link | ||
|- | |- | ||
|<code>|order | | rowspan=2 | <code>|order</code> | ||
| data-sort-value="flip" | <code>flip</code> | |||
| Inverts order of input, output measurements (conversion first) | | Inverts order of input, output measurements (conversion first) | ||
| Order | | Order | ||
|- | |- | ||
|<code>| | | data-sort-value="out" | <code>out</code> | ||
| Displays output units in the order entered, skipping input unit | |||
| Order | |||
|- | |||
| <code>|qid</code> | |||
| data-sort-value="qid Q1056131" | <code>Q1056131</code> {{small|1=(e.g.)}} | |||
| Reads Wikidata property from Wikidata item | |||
| Inside template; testing | |||
|- | |||
| <code>|qual</code> | |||
| data-sort-value="qual Q613628" | <code>Q613628</code> {{small|1=(e.g.)}} | |||
| Qualify Wikidata property | |||
| | |||
|- | |||
| rowspan=3 | <code>|round</code> | |||
| data-sort-value="05" | <code>5</code> | |||
| Rounds calculation to the nearest multiple of 5 | | Rounds calculation to the nearest multiple of 5 | ||
| | | Output precision | ||
|- | |- | ||
|<code> | | data-sort-value="25" | <code>25</code> | ||
| Rounds calculation to the nearest multiple of 25 | | Rounds calculation to the nearest multiple of 25 | ||
| | | Output precision | ||
|- | |- | ||
|<code> | | data-sort-value="each" | <code>each</code> | ||
| In a range, each number is rounded by the default rounding | | In a range, each number is rounded by the default rounding | ||
| | | Output precision | ||
|- | |- | ||
|<code>|sigfig=''N''</code> | | <code>|sigfig</code> | ||
| data-sort-value="N" | <code>''N''</code> | |||
| Round output number to ''N'' significant figures (''N'' is a positive integer) | | Round output number to ''N'' significant figures (''N'' is a positive integer) | ||
| Output precision | |||
|- | |- | ||
|<code>|sortable | | <code>|sortable</code> | ||
| | | data-sort-value="on" | <code>on</code> | ||
| Adds invisible sort key | |||
| Table sort | | Table sort | ||
|- | |- | ||
|<code>|sp | | <code>|sp</code> | ||
| Use U.S. spelling ( | | data-sort-value="us" | <code>us</code> | ||
| Use U.S. spelling ("meter" instead of default "metre") | |||
| Spelling U.S. names | | Spelling U.S. names | ||
|- | |- | ||
|<code>|spell | | rowspan=4 | <code>|spell</code> | ||
| data-sort-value="in" | <code>in</code> | |||
| Spell input number in words | | Spell input number in words | ||
| Spelling numbers | | Spelling numbers | ||
|- | |- | ||
|<code> | | data-sort-value="In" | <code>In</code> | ||
| Spell input number in words with first letter uppercase | | Spell input number in words with first letter uppercase | ||
| Spelling numbers | | Spelling numbers | ||
|- | |- | ||
|<code> | | data-sort-value="on" | <code>on</code> | ||
| Spell input and output numbers in words | | Spell input and output numbers in words | ||
| Spelling numbers | | Spelling numbers | ||
|- | |- | ||
|<code> | | data-sort-value="On" | <code>On</code> | ||
| Spell input and output numbers in words with first letter uppercase | | Spell input and output numbers in words with first letter uppercase | ||
| Spelling numbers | | Spelling numbers | ||
|- | |- | ||
|<code>|$= | | <code>|$</code> | ||
| data-sort-value="€" | <code>€</code> | |||
| Replace $-sign with a currency sign, for example in <code>$/acre</code> {{nowrap|(no currency conversion happens)}} | | Replace $-sign with a currency sign, for example in <code>$/acre</code> {{nowrap|(no currency conversion happens)}} | ||
| Cost per unit | | Cost per unit | ||
|- | |- | ||
|<code>|debug | | <code>|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 ------------------------- --> | |- <!-- ----------------- Deprecated options ------------------------- --> | ||
|<code>{{! | | <code>{{!mxt|1=|disp}}</code> || data-sort-value="flip" | <code>flip</code> | ||
| '''Deprecated'''. Use {{mxt|1=|order=flip}} | |||
|<code> | |||
| '''Deprecated'''. Use {{ | |||
| Order | | Order | ||
|- | |- | ||
| <code>{{! | |<code>{{!mxt|1=|sing=}}</code> || data-sort-value="" | | ||
| '''Deprecated'''. Use {{mxt|1=|adj=}} | |||
| Plurals | |||
|} | |||
| '''Deprecated'''. Use {{ | |||
| | |||
| | |||
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 |