Template talk:Convert/Archive August 2019

Latest comment: 5 years ago by EEng in topic Small discrepancy


Output in miles and yards (or miles and feet) rather than miles and decimal miles

My apologies in advance but I can't see this option. I would like to see 5.5 km converted to 3 miles 735 yards. (Actually what I really want is X miles Y chains to X miles Z yards but let's keep it simple for the moment).

  • If I do {{convert|5|km|mi}} I get 5 kilometres (3.1 mi) as I expect.
  • If I do {{convert|5|km|mi yd}} I get 5 kilometres (3.1 mi; 5,500 yd) which I should expect per documentation but is not what I want.
  • If I do {{convert|3|mi|735|yd|km|1}} I get 3 miles 735 yards (5.5 km) as I expect.
  • If I do {{convert|5|km|mi|yd}} I get 5 kilometres (3.1 mi)* I get an error, but as I should expect.

Am I missing something?

(If it the function is not currently supported, I have no intention of making a case to have it developed. I have only come across one article where a manual conversion is in use, which is what I had been trying to "correct"). --John Maynard Friedman (talk) 16:52, 1 August 2019 (UTC)

John Maynard Friedman, searching Module:Convert/data I found miydftin but no miyd. adding it would be pretty easy, but it's not there at the moment. Frietjes (talk) 17:04, 1 August 2019 (UTC)
The utility of such a measurement eludes me. The most common way of measuring miles is with a vehicle odometer, which reads in miles to the nearest 0.1 mile on most US vehicles. Who would use one kind of measuring instrument to measure out the whole miles and switch to a different kind for the fractional mile? Jc3s5h (talk) 17:10, 1 August 2019 (UTC)
Me too but it is used at Quainton Road railway station#Wotton Tramway and an editor is defending it (see diff=908751961&oldid=908701138). I don't like manual conversions, they are too easy to subvert. But as I said, I don't see a case for any development work on it. (Who would do that? Never heard of Metric martyrs and Jacob Rees Mogg's new MOS).--John Maynard Friedman (talk) 18:10, 1 August 2019 (UTC)
as a demonstration, I added it here so {{convert|1|mi|57|ch|miyd km}} produces what is in that section. Frietjes (talk) 18:38, 1 August 2019 (UTC)
Now I'm embarrassed! I hope it didn't take more than a minute of your time. Is it now officially part of the code? --John Maynard Friedman (talk) 21:06, 1 August 2019 (UTC)
John Maynard Friedman, no reason to be embarrassed. anything put in Module:convert/extra is subject to relatively strict review before being merged into Module:convert/data to avoid bloat/bugs/etc. so, pending the result of this and other discussions, it may or may not be officially added. so, I wouldn't use it anywhere critical at the moment. you can find the small number of articles using the convert/extra with this search. Frietjes (talk) 21:33, 1 August 2019 (UTC)
See the Grand National where Aintree is given as 4 miles 514 yards. I doubt that you'd be allowed to drive any vehicle, even a US one, over the sacred turf. Martin of Sheffield (talk) 21:41, 1 August 2019 (UTC)

Hide input option

Is there a hide input option avalible? For example {{convert|1|m|feet|hideinput=yes}} would give "3.3 ft" instead of "1 metre (3.3 ft)" I would like to use it for {{Aircraft specs}} where the same value often is provided in multiple units leading to unnecessary conversions and lower precision. This problem has been discussed at Wikipedia talk:WikiProject Aircraft#Template:Aircraft specs merger bot. --Trialpears (talk) 21:12, 8 August 2019 (UTC)

{{convert|1|m|ft|disp=out}} gives 3.3 ft. -- DeFacto (talk). 21:22, 8 August 2019 (UTC)
Well I'm blind. Thank you! --Trialpears (talk) 21:30, 8 August 2019 (UTC)

Is there a land conversion preference?

Copied from Help talk:Convert#Is there a land conversion preference?


I see many examples in articles of converting acres to km^2, I would think acres should normally be converted hectares. If it's big enough to be measured in square miles, then sure, use square kilometers.Nerfer (talk) 20:07, 12 August 2019 (UTC)

I agree with you, Nerfer, and it seems that Wikipedia, or at least {{ Convert }}, does, too. The conversion units you prefer are its defaults:
  • {{Convert| 27| acres }}
    yields
27 acres (11 ha)
  • {{Convert| 27| sqmi }}
    yields
27 square miles (70 km2)
See Template:Convert/list of units. For an exhaustive (and exhausting) list, see Module:Convert/documentation/conversion data, which also has more-detailed information about the conversion operation.
--Thnidu (talk) 00:06, 13 August 2019 (UTC)
Please use Template talk:Convert for discussions about convert. At that page, Nerfer might like to link to a couple of examples. Possibly an infobox is producing the units mentioned. Johnuniq (talk) 00:30, 13 August 2019 (UTC)
@Johnuniq and Nerfer: I will copy this discussion there-- after supper. I would move it instead, but I'm leery of moving someone else's comments.
--Thnidu 00:54, 13 August 2019 (UTC)
--[[02:19, 13 August 2019 (UTC)
--(copied here) Thnidu (talk) 02:31, 13 August 2019 (UTC)
Understood. The situations I've seen were just individuals putting in their own conversion templates, I don't know that there's anything systemic about it, but I'll look around. Mostly I wanted to make sure I wasn't going against some convention by 'correcting' it, because sometimes WP surprises me. Nerfer (talk) 19:43, 13 August 2019 (UTC)
So I've converted Will Keith Kellogg, have not converted Robert Brooke Sr. (that one refers to thousands of acres, so square kilometers could be justified). I haven't really looked around specifically for this situation, just happened to see both of these in the last week. Randomly picking places, Central Park is pretty good, Harper's Ferry converts acres to km^2, while Grant Park covers all bases, so to speak - it converts to hectares, km^2 or m^2, depending on where in the article you are. I'm not sure if there's a good way to do a larger search. Nerfer (talk) 22:53, 13 August 2019 (UTC)
An advanced search for hastemplate:convert insource:/|acre/ shows 76,759 articles. You can always refine that if you are happy working with regular expressions. --RexxS (talk) 16:22, 18 August 2019 (UTC)

Small discrepancy

For User:Peter Horn/Sandbox.6
1132 in (8.7 mm) 8.59 mm (1132 in)
{{convert|11/32|in|mm|abbr=on}} {{convert|8.59|mm|in|frac=32|abbr=on}}
This is a discrepancy of {{convert|0.11|mm|in|frac=128|abbr=on}} 0.11 mm (1128 in) or {{convert|0.11|mm|in|4|abbr=on}} 0.11 mm (0.0043 in).
Peter Horn User talk 16:05, 28 August 2019 (UTC) in|

Not quite sure what you're saying, but my guess is it's explained by Template:Convert#Rounding:_100_ft_is_30_m_or_30.5_m_or_30.48_m?. EEng 21:48, 28 August 2019 (UTC)
@EEng:Nothing to do with Template:Convert#Rounding {{convert|11/32|in|mm|2|abbr=on}} 1132 in (8.73 mm)
{{convert|0.14|mm|in|frac=128|abbr=on}} 0.14 mm (1128 in) Peter Horn User talk 23:53, 28 August 2019 (UTC)
@Peter Horn: First of all:
  • {{convert|11/32|in|mm|abbr=on}}1132 in (8.7 mm)
Note that 11/32 inch is actually 8.73125 mm. The module rounds the displayed conversion to a sensible number of significant figures. But that's not the problem you encountered.
This is where the rounding hits your conversion:
  • {{convert|8.59|mm|in|frac=32|abbr=on}}8.59 mm (1132 in)
But 8.59 mm is about 0.338189 in. Now 0.338189 in = 10.8/32 in. Since fractions have integral numerators, that is rounded to 11/32 in.
In fact anything between 10.5/32 in (8.334 mm) and 11.5/32 in (9.128 mm) will round to 11/32 in. So:
  • {{convert|8.34|mm|in|frac=32|abbr=on}}8.34 mm (1132 in)
  • {{convert|9.12|mm|in|frac=32|abbr=on}}9.12 mm (1132 in)
That's the effect of rounding on the numerator. --RexxS (talk) 00:35, 29 August 2019 (UTC)
Thank you, RexxS. I have a pounding headache and wasn't looking forward to untangling that. EEng 00:46, 29 August 2019 (UTC)