Template talk:Convert/Archive April 2017

objects per unit
At Transport in Barbados is the statistic "Barbados had 63.1 vehicles for every 1 km of road". I'd like to add a conversion to get the figure per mile as well, but I've not been able to figure out how to do that. Thryduulf (talk) 20:14, 1 April 2017 (UTC)
 * The only defined "per" units are of type "per unit area" and "per unit volume". However, convert provides automatic per units, and I am astonished to see that this works:
 * → 63.1 /km
 * Getting the exact wording could possibly be achieved using the options at Help:Convert, but people are likely to join here and correctly object about the ugliness of the above syntax is, so I won't try more at the moment.
 * Another ugly approach is to duplicate the input value:
 * Barbados had 63.1 vehicles for every 1 km of road (63.1 /km).
 * Barbados had 63.1 vehicles for every 1 km of road (63.1 /km).
 * Johnuniq (talk) 01:42, 2 April 2017 (UTC)
 * Thank you, I'll go with a slight tweak of the first option I think,  → Barbados had 63.1 vehicles per kilometre of road (101.5/mi) Thryduulf (talk) 09:02, 2 April 2017 (UTC)
 * Johnuniq (talk) 01:42, 2 April 2017 (UTC)
 * Thank you, I'll go with a slight tweak of the first option I think,  → Barbados had 63.1 vehicles per kilometre of road (101.5/mi) Thryduulf (talk) 09:02, 2 April 2017 (UTC)

Order of conversions when displaying multiple units
Manual_of_Style/Dates_and_numbers seems to state that most articles have the SI units first, followed by customary units. displays the opposite order by default though (3 Mach) and would need a manual indication of the order. In my opinion that should be changed. --Rabenkind (talk) 00:53, 2 April 2017 (UTC)
 * Convert does that because the default output unit for Mach is set to  (here). No other unit has that default, while   (knot) has  . A discussion here can change the default output for Mach, but a change will have to wait until the next time the modules are updated. Making the change seems desirable.
 * Now would be a good time to examine the page at the link I gave and work out if any other changes are needed.
 * I found the following with a default having SI units last. These look ok to me.
 * → 12 cda
 * → 12 rood
 * → 12 ch
 * → 12 fathom
 * → 12 furlong
 * → 12 hand
 * → 12 perch
 * → 12 pole
 * → 12 rd
 * → 12 dwt
 * → 12 impgalh2o
 * → 12 long cwt
 * → 12 long qtr
 * → 12 ozt
 * → 12 qtr
 * → 12 short cwt
 * → 12 short qtr
 * → 12 st
 * → 12 troy pound
 * → 12 usgalh2o
 * Johnuniq (talk) 01:26, 2 April 2017 (UTC)
 * The one that jumps out as inappropriate is the Cuerda. The others are converting an exotic (rarely used) unit to a base unit in their own systems first, then SI units, which makes a rough kind of sense. But Cuerda isn't an english unit. Indeed, from reading the template discussion and Wiki article, it really looks like it should simply not be in the conversion tables. At least not without a qualifying term to distinguish between other units of the same name. Puerto Rican cuerda, anyone?
 * The Troy masses aren't specifically in the avoirdupois system, but do have related bases (grains), so probably still kinda make sense to translate to english units first.
 * As for Mach, yeah, km/h or m/s would make more sense as a first unit. Tarl N.  ( discuss ) 02:13, 2 April 2017 (UTC)
 * I agree that cda is too vague to be defined in convert, as can be seen in my comment at the August 2013 discussion. In June 2016, a convert using cda was only in articles Cerrillos State Forest and Toro Negro State Forest. If there were support after a reasonable discussion, cda could be removed. If it is kept, I guess its default output order should be swapped. Johnuniq (talk) 03:00, 2 April 2017 (UTC)


 * , it looks like the issue you raise will eventually go live, but in the meantime you can use the following code to force your desired output: 3 Mach → 3 Mach. — Huntster (t @ c) 02:53, 2 April 2017 (UTC)
 * Isn't it simpler than that:
 * → 3 Mach
 * Johnuniq (talk) 03:00, 2 April 2017 (UTC)
 * Yeah, I'm dumb. Been using order=out a lot so I guess it's on the brain. — Huntster (t @ c) 12:59, 2 April 2017 (UTC)


 * I noticed in passing that there seems to be a Mach number conversion template giving a value in mph and km/h, but it does not specify the medium and conditions. Mach number is a factor of the speed of sound, which can vary considerably even in atmospheric air, which is the usual assumption if nothing else is specified, Is the conversion for standard atmospheric pressure and temperature? (at sea level) &bull; &bull; &bull; Peter (Southwood) (talk): 16:17, 2 April 2017 (UTC)
 * Yes, I would be in favor of removing this conversion for this reason. Kendall-K1 (talk) 16:35, 2 April 2017 (UTC)

Does a "Mach number conversion template" refer to convert or another template? Which? For convert, "standard" atmosphere is assumed and it is possible to specify the altitude in feet (immediately after the Mach unit, and it only works for Mach as an input). The altitude can be negative for anyone flying in a canyon below sea level. The source is http://www.aerospaceweb.org/question/atmosphere/q0112.shtml The assumed significant figures are dubious, so specifying sigfig might be best. Johnuniq (talk) 00:44, 3 April 2017 (UTC)
 * → 12 Mach
 * → 12 Mach
 * → 12 Mach
 * → 12 Mach
 * The conversion does not display the altitude, which leaves the result poorly defined. Perhaps the altitude could be mentioned in the output, including sea level for the default, otherwise use assumes knowledge of the conditions by the editor and the reader, which is generally overoptimistic. &bull; &bull; &bull; Peter (Southwood) (talk): 07:07, 3 April 2017 (UTC)

Compatible sort key without actually converting?
Is there another template (or a way to use this one) that gives compatible formatting and sort key to this one, but doesn't actually convert?

The use case I have in mind is a sortable table where the input data has all different units, and you want to convert everything to comparable units and let the column be sortable, but some of the input data is already in the same units as what everything is being converted to. So for these particular cells you only want one value, but the sort key still has to be there. —Keenan Pepper 16:50, 4 April 2017 (UTC)
 * A unit can be converted to itself. Also, val uses convert to generate a hidden sort key by default. Examples:
 * → 12.3 m2
 * Of course  would be omitted in an article. The above shows that the sort keys are the same. Please provide an example if this is not sufficient. Johnuniq (talk) 04:43, 5 April 2017 (UTC)
 * Of course  would be omitted in an article. The above shows that the sort keys are the same. Please provide an example if this is not sufficient. Johnuniq (talk) 04:43, 5 April 2017 (UTC)

Power to weight ratio for cars
What's a good way to have conversions between hp/lb, hp/kg, kW/kg and PS/kg ?  Stepho  talk 22:48, 11 April 2017 (UTC)


 * Convert handles automatic per units but the defaults are often useless because the default for an input unit like X/Y is formed from the default for X per the default for Y. Are these sufficient?
 * → 12 hp/lb
 * → 12 hp/lb
 * → 12 hp/lb
 * Johnuniq (talk) 23:00, 11 April 2017 (UTC)


 * Yes, that looks excellent. Thank you very much.  Stepho  talk 13:24, 13 April 2017 (UTC)

Chinese unit of area - mu (亩 or 畝)
From 1930 the Chinese units of measurement area mu (亩 or 畝) has a value of  666 2⁄3 m2 or 797.3 sq yd or 0.1647 acre. How to put it in? 122.193.88.126 (talk) 08:12, 17 April 2017 (UTC)
 * There are a lot of units at that page, and others, which conceivably could be added to convert, but first please give a couple of examples (text in some articles) where a conversion would be useful. If it's only a small number of times, I'm not sure a new unit would be helpful. Johnuniq (talk) 09:46, 17 April 2017 (UTC)

Enhancement request for mm/year
Right now, convert mm/year yields this:

&rarr; 2 mm/year

For those reading this after a potential fix, the result is "2 millimetres per year (0.0025 in/Ms)".

I think it would be better to display the result in in/year. I know that I can manually do:

&rarr; 2 mm/year

But it would be good to have a reasonable default. Thanks for considering this enhancement. – Jonesey95 (talk) 21:24, 21 April 2017 (UTC)
 * Convert can handle many units that are not defined using "engineering notation" or "automatic per". For example, there is no such unit as  but it works because   is regarded as a 106 multiplier, and acre is a recognized unit. Similarly, there is no such unit as   but convert interprets it as X/Y (X per Y) where X and Y are known units. The default output unit is formed from the default for X per the default for Y.
 * → 12 mm
 * → 12 year
 * → 12 mm/year
 * → 12 mm/year
 * As noted, the default unit is pretty useless for the above, although it works in some cases.
 * If  is used sufficiently often for the bad default to be a problem, the solution would be to define the unit with the wanted default. I can do that if you think it is needed. Johnuniq (talk) 23:01, 21 April 2017 (UTC)

Adding various astronomical distance & mass measurements
Would it be possible to add to the convert template such units as Lunar distances and Earth radii (for use on articles like List of asteroid close approaches to Earth, articles for asteroids passing near the Earth, size comparisons for exoplanets and the likes, etc) as well as Earth Masses and Solar Masses (again, for exoplanets, brown dwarfs, stellar objects, and really anything weighing more than a few tonnes...) Frankly it surprises me that these important units are not included already. Is there any reason that I am missing? exoplanetaryscience (talk) 20:06, 28 April 2017 (UTC)
 * Neither one of those units has a single precise value. Kendall-K1 (talk) 20:51, 28 April 2017 (UTC)
 * While some have slightly different definitions, only one of each of these values is in widespread use. Even if not, they do have a single widespread use on Wikipedia at least. Other rare or obsolete units not in common use are ignored, such as the numerous variations of an ounce. Perhaps not the best example, but the use of these units is fairly well standardized among astronomers. exoplanetaryscience (talk) 21:00, 28 April 2017 (UTC)
 * From an earlier discussion (I think it was solar radius), the discussion goes more easily if you can provide a list of articles where the conversion is currently done manually, and you would fix them to use the convert template. To make things easier on everyone, provide a list of wikilinks and describe where the conversions currently are. if you can show that there has been confusion from people incorrectly converting them and reverting, that's a bonus. Tarl N.  ( discuss ) 21:26, 28 April 2017 (UTC)
 * For one thing, lunar distance is used extensively on List of asteroid close approaches to Earth and its subpages with requests (and future intention to eventually add Earth radii.) Solar masses, Earth masses, and additionally Jupiter masses are also used frequently in Exoplanet & BD articles (like Luhman 16 and Scholz's star's infoboxes, which could both appropriately include conversions of Jupiter masses & Solar masses as intermediate-mass brown dwarves, as well as exoplanets like 2MASS J19383260+4603591 b and HD 155233 b, which explicitly convert earth masses/jupiter masses, and numerous objects using template:planetbox, among them EPIC 2037 b and HD 108147 b include conversions with Jupiter and Earth masses, as well as their respective radii.) Those examples are based on a cursory search, based on which I project that there are probably dozens (among the hundreds) of exoplanet articles needing this conversion, and a similar proportion of the dozens of brown dwarf pages. Although plenty of intermediate-size objects from both categories don't use these conversions, I imagine it's due to the difficulty of converting between these already. Although that would be hard to demonstrate, it certainly serves as a sort of feedback mechanism for why it is not as widespread as one might expect it to be.
 * "While some have slightly different definitions, only one of each of these values is in widespread use." Well then someone needs to work on both of those articles, because that's not what it says in the lead. Kendall-K1 (talk) 22:22, 28 April 2017 (UTC)
 * As noted above, a few precise examples where a conversion would help are needed. I had a quick look at a couple of the links given but searching for "rad" did not find anything—please identify text. Also, what values would be used, and as Kendall-K1 indicates, what reason is there to think that such values are widely used for measurements? Johnuniq (talk) 00:02, 29 April 2017 (UTC)
 * I think the example exo is pointing to is List of asteroid close approaches to Earth, where the geocentric distances are given in both km and lunar distances. The thing I keep in mind is that additions to the list of measurements are not cost-free, they incrementally increase the cost both in cpu cycles and maintenance burden. But that's a tradeoff to be decided. Tarl N.  ( discuss ) 00:34, 29 April 2017 (UTC)
 * OK, thanks. I searched for "rad" to find any Earth-radius measurements and missed that the table uses "LD" for lunar distance. I suppose that if similar examples for the radius exist, and if a proposal at the relevant wikiproject does not raise any problems, some units could be added on a trial basis to see how they turn out. The proposal, with details, should be discussed at the project and a link added here when there is agreement, or at least lack of objection after a couple of days. For each unit, the details to be decided are: precise km value, unit code used in the convert template, symbol (if abbreviated) and name (if not) to be displayed. Johnuniq (talk) 02:50, 29 April 2017 (UTC)
 * Think I've pinged everyone, hope I covered the relevant details! link. exoplanetaryscience (talk) 05:15, 29 April 2017 (UTC)