Template:Convert/doc/FAQ

Note: This page was just created 22 November 2010, and is still being expanded.

Most common questions

 * Q: When using convert why does the answer not seem right sometimes?
 * A: This template takes into account the precision of the supplied value and generally rounds to the same level of precision. If you need to change from the default output precision, see the "Rounding" section of the template documentation.


 * Q: What are all the possible units (kg, lb, m, cm, ft, in, °C, °F, km, mi, nmi, mph, km/h, and so on)?
 * A: See: Template:Convert/list of units.


 * For more questions, see: Template_talk:Convert/FAQ.

Showing words with conversions

 * Q: Can a conversion say "million" rather than use zeroes "000,000"?
 * A: Yes, there many unit codes with prefixes e3/e6/e9 to show "thousand" or "million" or "billion" units (such as: e6acre, to show "million acres"). The output unit code can also use the e3/e6/e9 prefix, or use typical units to show input "million" but output with zeroes "000". Some examples:
 * 14 e6acre &rarr; 14 e6acre
 * 14 e6acre &rarr; 14 e6acre
 * 1 e6mi     &rarr; 1 e6mi
 * 2.2 e6mi &rarr; 2.2 e6mi
 * 3.3 e6mi     &rarr; 3.3 e6mi
 * For a list of the other e3/e6/e9 units, see: Template:Convert/list of units.


 * Q: How are customized, extra words shown within a conversion?
 * A: Append "disp=x|aaa|bbb" where "aaa" is the text after the input amount and "bbb" is shown after the output amount. Examples:
 * 9 m     &rarr; 9 m
 * 9 m     &rarr; 9 m
 * 4 m &rarr; 4 m
 * 2 mi &rarr; 2 mi
 * When using disp=x, then the parentheses "" are turned off for that conversion, but can be re-added (as "disp=x|deep (|)" for example). However, inserting "or" is common. There is no limit to the total number of words inserted in a conversion. For example:
 * 35 cm      &rarr; 35 cm
 * In many cases, "bbb" can be omitted because the text following a conversion is, essentially, the "bbb" as the continued text of the article. Sometimes, extra words can be inserted just to break the monotony of many conversions in a row: "aa miles (bb km), cc miles (dd km), and eee miles (same as fff km)".

Changing the format

 * Q: How can we reverse the order of input and output units?
 * A: Using "disp=flip" reverses the order, or flips the units, so that the input unit is displayed in reverse order, as being the output unit. Examples:
 * 23 km     &rarr; 23 km
 * 9 m     &rarr; 9 m
 * 9 m &rarr; 9 m
 * 27 mm &rarr; 27 mm
 * 6 ft &rarr; 6 ft
 * 6 ft &rarr; 6 ft
 * Flipping the units is common when a source document uses metric numbers but the article doesn't, such as a British news source quoting "metres" about an American topic using feet as typical in American English. So, the display is reversed, showing feet first, then the source metres in "".


 * Q: How can we show just the output amount and omit the input?
 * A: Convert allows "disp=out" (or "disp=output only") to show only the output amount/unit, and omit the parentheses "". Examples:
 * 6 ft &rarr; 6 ft
 * 97 km &rarr; 97 km
 * 97 km &rarr; 97 km
 * To show just the number (not the unit), use disp=number (or "disp=output number only"):
 * 6 ft &rarr; 6 ft
 * 97 km &rarr; 97 km
 * The option "abbr=off" can stop the abbreviations and show output with a full unit name, rather than the unit symbol.


 * Q: How can we show just the output unit name (singular/plural) and omit the amount?
 * A: Convert has option "disp=u2" (for unit 2) to show only the output unit name (or unit symbol), and omit the parentheses "" and amount. Examples:
 * 6 ft &rarr; 6 ft
 * 6 ft &rarr; 6 ft
 * 97 km &rarr; 97 km
 * 97 km &rarr; 97 km
 * The option "disp=unit" (shown below) will show the input unit name (or unit symbol), rather than the output unit name.


 * Q: How can we show just the unit name and omit the numbers?
 * A: Convert allows "disp=unit" to show only the unit name or unit symbol. Examples:
 * 6 ft &rarr; 6 ft
 * 1 ft &rarr; 1 ft
 * 4 cuyd &rarr; 4 cuyd
 * 1 km/h &rarr; 1 km/h
 * 1 km2 &rarr; 1 km2
 * The option "disp=unit" is typically used to select either the singular, or plural, name for an amount of a particular unit, but it can also show a formal unit symbol by including "abbr=on" with a unit code.

Performance concerns

 * Q: Convert seems big, but can Convert run faster as used?
 * A: An attempt has been made to optimize Convert to run in groups of tiny templates. However, setting the precision can avoid almost half of those templates, such as round by 0, 1 or set sigfig=3 (or similar). In many cases, just round as "|0" or for thousands, use "|-3". Some examples:
 * 9 m     &rarr; 9 m   [ default ]
 * 9 m     &rarr; 9 m   [ round 0 ]
 * 9 m     &rarr; 9 m [ round 1 ]
 * 9000 m     &rarr; 9000 m   [ round 0 ]
 * 9000 m     &rarr; 9000 m   [ round -3 ]
 * 9000 m     &rarr; 9000 m
 * 32 m     &rarr; 32 m [ default ]
 * 32 m     &rarr; 32 m [ round 0 ]
 * 32 m     &rarr; 32 m [ round 1 ]


 * Q: Convert seems to cause some  red error messages, why?
 * A: There are some other large templates which consume resources needed when using Convert inside those templates:


 * Nest 20 templates & use {Convert|9|m}:


 * Nest 20 templates & use {Convert|9|m}:
 * Nest 20 templates & use {Convert|9|m|0}:
 * Other Wikipedia templates might be using many levels of nested logic, leaving fewer for Convert. Convert has been optimized to run in groups of tiny templates. However, setting the precision can avoid several of those nested templates, such as round by 0, 1 or set sigfig=2 (or similar). In many cases, just round as "|0" or for thousands, use "|-3". Some examples:
 * 7 m     &rarr; 7 m   [ round 0 ]
 * 7000 m     &rarr; 7000 m   [ round 0 ]
 * 7000 m     &rarr; 7000 m   [ round -3 ]
 * 7000 m     &rarr; 7000 m
 * Using either rounding by "0" or sigfig=3 (or such) will reduce the nested Convert templates by the same 8-11 nested levels to allow using more templates.

Writing new unit subtemplates
&bull; "WP:Advanced Convert coding". However, due to markup complexity, instead many users ask, at the bottom of the talk-page, Template_talk:Convert, for a more-experienced user to create the new subtemplate.
 * Q: The unit I need is not in the list, so can I create a subtemplate for it?
 * A: Yes, Convert allows anyone to create a new unit subtemplate, of the form Template:Convert/myunit, to handle a new unit-code named "myunit" by copying another unit subtemplate.
 * The process, for creating a subtemplate to convert a new unit-code, is explained on the page:


 * Q: When I reverse a conversion, from a&rarr;b to b&rarr;a, why is it off by 1 million (1,000,000)?
 * A: Sometimes, a new unit has a coding error. Inside a unit subtemplate, the parameter b also acts as a conversion divisor and needs to use outer parentheses "" in the calculation.
 * Beware a multiplication: b=(45/9)*1000,
 * which needs outer "":  b=( (45/9)*1000 )  to keep the "1000" in the divisor. Without the outer parentheses, the " *1000" would increase the calculation by 1,000x bigger, rather than 1,000x smaller, so the overall result zooms off by 1,000×1,000 or 1,000,000, as being 1 million too big.