Help:Convert messages

From Wikibooks, open books for an open world
Jump to navigation Jump to search

This page describes the error and warning messages reported by Module:Convert if a problem is detected while using {{convert}} to convert a value from one unit of measurement to another.

Asking questions[edit]

If a problem cannot readily be resolved, please report it at one of the following.

Error and warning messages[edit]

Needs a number[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|123|m|ft}} → 123 meters (404 ft)
  • {{convert||m|ft}}Expression error: Unexpected < operator. meters (Expression error: Unexpected < operator.Expression error: Missing operand for *.ft)

An input number is required. In the first example above, the input number is 123.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Needs another number[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|10|x|20|m|ft}} → 10 by 20 meters (33 × 66 ft)
  • {{convert|10|x| |m|ft}} → 10 by Expression error: Unexpected = operator. meters (33 × Expression error: Unexpected < operator. ft)
  • {{convert|10|x|20|x| |m|ft}}Template loop detected: Template:Convert/x

The first input number was specified, but the range used requires another number.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid number[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|1|km|ft}} → 1 kilometer (3,300 ft)
  • {{convert|km|ft}}Expression error: Unrecognized word "km". feet (Expression error: Unexpected < operator.Expression error: Unrecognized word "km".m)

A number to be converted can be entered as in these examples: 1.23 or 1,234 or -0.9.

Fractions are entered as in these examples: 1+2/3 (1 23) or -1-2/3 (−1 23) or 2/3 (23).

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Number overflow[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|1e290|m|ft}} → 1e290 meters ( ft)
  • {{convert|1e310|m|ft}} → 1e310 meters (Expression error: Unrecognized word "inf". ft)

This error occurs if a number exceeds the range of values available for calculations. The number 1e290 means 1×10290.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid precision[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|21455|acre|ha|2}} → 21,455 acres (8,682.53 ha)
  • {{convert|21455|acre|ha|-2}} → 21,455 acres (8,700 ha)
  • {{convert|21455|acre|ha|2.5}}Template:Convert/warning

A precision value is entered after the conversion information. For example, |2 gives a result that is rounded to two decimal places, while |-2 rounds to the nearest 100 so that two zeroes occur at the end of the number. This message will only appear if warnings have been enabled.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Precision too large[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|123|m|ft|2}} → 123 meters (403.54 ft)
  • {{convert|123|m|ft|200}} → 123 meters (403.5433070866100 ft)

Generally there is no reason to use a precision of more than a few decimal places, however, larger values may be used. The error shown occurs if the requested precision is higher than the maximum supported by the server.

A negative precision rounds to the nearest 10 (parameter |-1), or nearest 100 (|-2), or nearest 1000 (|-3), etc. A large negative precision produces a zero output.

  • {{convert|123|m|ft|-2}} → 123 meters (400 ft)
  • {{convert|123|m|ft|-200}} → 123 meters (0 ft)

Using a very small input value can cause the default precision to exceed the limit (1.234e-200 is 1.234×10−200). For such very small values, it is better to use the |sigfig= option.

  • {{convert|1.234|m|ft}} → 1.234 meters (4.05 ft)
  • {{convert|1.234e-200|m|ft}} → 1.234e-200 meters (4.0×10−200 ft)
  • {{convert|1.234e-200|m|ft|sigfig=3}} → 1.234e-200 meters (4.05×10−200 ft)

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid fraction[edit]

Mouseover the message to see further information.[lower-alpha 1]

A fraction denominator can be specified to display results with a fraction where appropriate. For example, |frac=8 specifies that the value should be rounded to the nearest eighth, and that a fraction should be included if necessary. A fraction denominator must be a whole number with value 2 or more. This message will only appear if warnings have been enabled.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid sigfig[edit]

Mouseover the message to see further information.[lower-alpha 1]

The number of significant figures in the result can be specified. For example, |sigfig=2 requests two significant figures. The number of significant figures must be a whole number with value 1 or more. This message will only appear if warnings have been enabled.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Deprecated option[edit]

Mouseover the asterisk after the convert result to see further information.[lower-alpha 1]

  • {{convert|123|m|ft|sortable=on}}&10000000000000123000000123 meters (404 ft)
  • {{convert|123|m|ft|sortable=out}}7002123000000000000123 metres (404 ft)*

The option |sortable=on outputs a hidden sort key for use in a sortable table. The option |sortable=out is now the same as |sortable=on, and the latter should be used. See deprecated options for information regarding which options should be used to replace those that are being phased out.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Empty option[edit]

Mouseover the message to see further information.[lower-alpha 1]

The option |sp=us specifies that US spelling should be used ("meters" instead of "metres"). However, |sp= has no effect as no value is specified. This message will only appear if all warnings have been enabled.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid option[edit]

Mouseover the message to see further information.[lower-alpha 1]

The option |abbr=off specifies that abbreviations are off, that is, unit names will be used instead of symbols. By contrast, |abr=off is ignored because "abr" is not the name of an option. This message will only appear if warnings have been enabled.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Needs unit name[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|12|ft}} → 12 feet (3.7 m)
  • {{convert|12}} → {{convert/{{{2}}}|12|0|||||||r=er|d=LoffAoffDbSoff|s=}}
  • {{convert|12||ft}}
    ERROR {Convert}: Invalid parameters: 1=12 2= 3=ft 4= 5= 6= with {u}= n= .
                 Try using range: {{convert|12||ft...}} to convert a range of numbers.
  • {{convert|12|x|20|ft}} → 12 by 20 feet (3.7 × 6.1 m)
  • {{convert|12|x|20}}
    ERROR {Convert}: Invalid parameters: 1=12 2=x 3=20 4=def 5= 6= with {u}= n= .
                 Try using range: {{convert|12|x|20...}} to convert a range of numbers.

A unit code must be specified following the input number or numbers.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Unknown unit[edit]

Mouseover the message to see further information.[lower-alpha 1]

Each unit code must exactly match a known unit, case sensitive. A simplified list of unit codes is at Help:Convert units, and all available unit codes are here.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Unit mismatch[edit]

Mouseover the message to see further information.[lower-alpha 1]

  • {{convert|123|psi|Pa}} → 123 pounds per square inch (850,000 Pa)
  • {{convert|123|psi|ha}} → 123 pounds per square inch (85 ha)

It is only possible to convert between units that have the same type. For example, psi and Pa are each of type "pressure" so a psi value can be converted to Pa. However, a psi value cannot be converted to a unit of a different type, such as ha (hectare) which has type "area".

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Ambiguous unit[edit]

Mouseover the message to see further information.[lower-alpha 1]

Some unit codes are not supported; using them results in an message indicating that a different unit code should be chosen.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Unit invalid here[edit]

Mouseover the message to see further information.[lower-alpha 1]

Some units can only be used as outputs. For example "C F" displays a temperature in Celsius and Fahrenheit. Such a unit cannot be used with an input value, because, for example, there is no such temperature as "123 C F". Some output combinations are predefined—"C F" is one example, and "mi km" (miles and kilometres) is another. It is also possible to construct an output combination by joining unit codes with "+". However, individual units have to be specified, and an output combination cannot be used.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Wikidata problem[edit]

Mouseover the message to see further information.[lower-alpha 1]

An unexpected error occurred while attempting to use the Wikidata modules to read property or item information. This error should not occur; the above is a simulation of what would be displayed if, for example, the Wikidata modules were not available, or if they contained an error.

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Invalid input[edit]

Mouseover the message to see further information.[lower-alpha 1]

Convert is configured to display any input text without error if a conversion fails, so this error should not occur. The above is a simulation of what would be displayed if convert were configured to show problems when a conversion was not possible.

The following examples use the input parameter. The unit mV is known to convert, but since no useful conversion is possible, there is no output. There is no boxes unit, so the input is displayed as given. The final example follows the same rule because P123. is not a valid property identifier.

  • {{convert|input=12 mV}} → {{convert/{{{2}}}|{{{1}}}|0|||||||r=er|d=LoffAoffDbSoff|s=}}
  • {{convert|input=12 mV|abbr=on}} → {{convert/{{{2}}}|{{{1}}}|0|||||||r=er|d=LoffAonDbSoff|s=}}
  • {{convert|input=12 boxes}} → {{convert/{{{2}}}|{{{1}}}|0|||||||r=er|d=LoffAoffDbSoff|s=}}
  • {{convert|input=P123.}} → {{convert/{{{2}}}|{{{1}}}|0|||||||r=er|d=LoffAoffDbSoff|s=}}

Pages with this error are automatically placed in Category:Convert errors.[lower-alpha 2]

Notes[edit]

  1. a b c d e f g h i j k l m n o p q r If the mouse pointer is positioned over the convert message (mouseover), extra information will appear in a popup window.
  2. a b c d e f g h i j k l m n o p q r A category is only included if the page is an article (a page in the main namespace).