Template:Convert/doc/range separator list
From MediaWiki
[}}
|
#default = Convert/doc/range separator list | =
{{#ifeq: | |
Template:Convert/doc/range separator list | Convert/doc/range separator list
}}}}|{{#if:|v|view}}]] |
#default = Convert/doc/range separator list | =
{{#ifeq: | |
Template:Convert/doc/range separator list | Convert/doc/range separator list
}}}}|action=edit}} {{#if:|e|edit}}]}}{{#if:|]}}Range separators in {{convert}} | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Separator | Convert | Result | Notes | |||||||||
-
|
{{convert|3|-|6|ft}}
|
convert}} | Input can be hyphen (-) or en dash (–), output uses en dashes | |||||||||
-– – (en dash)
|
{{convert|3|–|6|ft}}
|
convert}} | ||||||||||
and
|
{{convert|3|and|6|ft}}
|
convert}} | ||||||||||
and&&
|
{{convert|3|&|6|ft}}
|
convert}} | Same as and
| |||||||||
and(-)
|
{{convert|3|and(-)|6|ft}}
|
convert}} | |{{#if:abbr|abbr=}}on alters the punctuation
| |||||||||
and(-)|abbr=on
|
{{convert|3|and(-)|6|ft|abbr=on}}
|
convert}} | ||||||||||
or
|
{{convert|3|or|6|ft}}
|
convert}} | ||||||||||
to
|
{{convert|3|to|6|ft}}
|
convert}} | ||||||||||
to(-)
|
{{convert|3|to(-)|6|ft}}
|
convert}} | |{{#if:abbr|abbr=}}on alters the punctuation
| |||||||||
to(-)|abbr=on
|
{{convert|3|to(-)|6|ft|abbr=on}}
|
convert}} | ||||||||||
to about
|
{{convert|3|to about|6|ft}}
|
convert}} | ||||||||||
+/-
|
{{convert|3|+/-|6|ft}}
|
convert}} | ||||||||||
+/-± ±
|
{{convert|3|±|6|ft}}
|
convert}} | ||||||||||
+
|
{{convert|3|+|6|ft}}
|
convert}} | ||||||||||
,
|
{{convert|3|,|6|ft}}
|
convert}} | ||||||||||
, and
|
{{convert|3|, and|6|ft}}
|
convert}} | ||||||||||
, or
|
{{convert|3|, or|6|ft}}
|
convert}} | ||||||||||
by
|
{{convert|3|by|6|ft}}
|
convert}} | ||||||||||
x
|
{{convert|3|x|6|ft}}
|
convert}} | Scientific notation.|{{#if:abbr|abbr=}}on alters the punctuation
| |||||||||
× ×
|
{{convert|3|×|6|ft}}
|
convert}} | ||||||||||
x|abbr=on
|
{{convert|3|x|6|ft|abbr=on}}
|
convert}} | ||||||||||
xx
|
{{#ifeq:Template | Template:FormattingError||xx|}} is deprecated. Use {{#ifeq:Template | Template:FormattingError||x|}} instead | |||||||||
*
|
{{#ifeq:Template | Template:FormattingError||*|}} is deprecated. Use {{#ifeq:Template | Template:FormattingError||x|}} instead | |||||||||
to-
|
{{#ifeq:Template | Template:FormattingError||to-|}} is deprecated. Use {{#ifeq:Template | Template:FormattingError||to(-)|}} instead | |||||||||
&
|
{{#ifeq:Template | Template:FormattingError||&|}} is deprecated. Use {{#ifeq:Template | Template:FormattingError||and|}} instead | |||||||||
abbr=mos
|
{{#ifeq:Template | Template:FormattingError||abbr=mos}} is deprecated. Use {{#ifeq:Template | Template:FormattingError||x|}} or {{#ifeq:Template | Template:FormattingError||by|}} instead |
{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}
[edit] Later more
The following ranges provide different output when units are abbreviated.
Convert | Output |
---|---|
<code>{{convert|3|and(-)|6|ft|abbr=on}} | convert}} |
{{convert|3|to(-)|6|ft|abbr=on}}
|
convert}} |
{{convert|3|x|6|ft|abbr=on}}
|
convert}} |
Ranges can use more than two values.
Convert | Output |
---|---|
<code>{{convert|3|x|4|x|24|in}} | convert}} |
{{convert|3|x|4|to|6+1/2|x|8+3/4|in}}
|
convert}} |
Ranges can be specified in the first parameter.
Convert | Output |
---|---|
<code>{{convert|3.2-7.5|ha}} | convert}} |
{{convert|3x4x24|in}}
|
convert}} |
- From module
- convert/text
range_words = { '+/-', 'to(-)', 'xx', 'x', '*', 'to', 'or', 'by', '–' , '-' }
So:
- {{safesubst:#invoke:convert|convert}}
- to(-) {{safesubst:#invoke:convert|convert}}
- to(-) a {{safesubst:#invoke:convert|convert}}
- and(-) {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- a {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}
- {{safesubst:#invoke:convert|convert}}