User:Johnuniq/Convert notes

While working on Module:Convert, I have noticed some issues with the Template:Convert family. That is hardly surprising given the enormous number of units and options that it efficiently handles, but I thought it would be useful to document what I found. I put a link to this at Template talk:Convert (now archived here) on 13 February 2013, but I'm putting this here because it's too long for that talk page. If anyone feels inclined to work on this page, please edit as wanted. Johnuniq (talk) 23:46, 25 March 2013 (UTC)
 * Some resolved items have been removed, and some more sections have been added. Johnuniq (talk) 02:49, 16 September 2013 (UTC)
 * Most of the issues or precision problems were corrected in the markup-based Convert during late November 2013. -Wikid77 (talk) 06:43, 30 November 2013 (UTC)

Issues

 * Convert//acre has  which should be.

The following should convert to kelvin:
 * → 123 F
 * → 123 F
 * → 123 C
 * → 123 C
 * Fixed for kelvins. -Wikid77 21:35, 27 November 2013 (UTC)
 * Fixed for kelvins. -Wikid77 21:35, 27 November 2013 (UTC)

Some minor issues may need adjusting:
 * → -12 lb

Unit Mach accepts parameter 4 as an altitude. However, that gives incorrect results and outputs a hidden category (Category:Pages with bad rounding precision) if the altitude does not contain a comma ("95,000" is ok, but "95000" is incorrect). For example: convert/Mach has incorrect values in the table of altitudes (the switch values are repeated, starting at " ". For example (the output should be "(16,000 mph; 25,000 km/h)":
 * → 10 Mach
 * → 10 Mach
 * → 24 Mach

Can use  for a minus sign, but it gives invalid results:
 * → -4 km
 * → &minus;4 km

Negative numbers can give rounding inconsistency:
 * → 1200 m
 * → -1200 m
 * → -1200 m

Specifying  in a range can give an expression error:
 * → 0 - 10 m
 * → 0 - 10 m

Specifying  with an output combination can give an expression error:
 * → 3 st
 * → 3 st

Can get incorrect output values when converting certain values with a multiple output unit. In the first of the following, 152.4 m is exactly 500 feet, and that value is somehow interpreted as zero and omitted.
 * → 152.4 m
 * → 304.8 m
 * → 1 ch
 * → 42 ft
 * → 3,175.14659 kg
 * → 0.22321428571429 LT

Consistency problems

 * → 1230 m3/s
 * → 1.23 e3m3/s


 * → 1+1/2 in
 * → 1+1/2 in
 * → 1+1/2 in
 * → 1+1/2 mi


 * → 18 in
 * → 1 ft


 * → 18 in
 * → 1 ft


 * → 4500 acre ft
 * → 4500 - 4900 acre ft


 * → 1/3 mi
 * → 1/3 mi
 * → 0.4 m
 * → 0.4 m


 * → 0.1 - 0.2 m



Convert/3 and convert/4 ignore precision parameter.

Other issues
No error checking for conversions between units of different types:
 * → 1 mi
 * → 1 mi
 * → 1 m3/s

Incorrect error message before result:
 * → 1 kWh

Negative zero in result:
 * → -18 C

Redundant input can give a fraction glitch:
 * → 0+3/8 mi

Template problem gives  in output:
 * → 15 to 32 mpgus

Template problem gives error message:
 * → 1 to 10 USgal/d

Rounding input sometimes fails. Currently, the second of these gives the correct output, but shows several lines of error messages for the input.
 * → 12345.45 m
 * → 123456.45 m

Minor issues
Some minor consistency and other issues are shown in the following table which shows results from the module and the template.