Jump to content

Template talk:Convert/Archive October 2012

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia


Singular unit names

At present, {{convert|50|m}} produces:

50 metres (160 ft)

Would it be possible to provide an option for it to do this?

50 metre (160 ft)

At present, the formulation means you can't use it in a sentence like "XYZ is a 50 metre (160 ft)-long thingumajig built in 1896 and now on display in the Museum of Whatnot."

Hex (❝?!❞) 08:10, 2 October 2012 (UTC)

Use {{convert|50|m|adj=on}} for "50-metre (160 ft)" (note the hyphen per standard English grammatical rules). JIMp talk·cont 08:45, 2 October 2012 (UTC)
Or use {{convert|50|m|ft|adj=mid|-long}} to produce 50-metre-long (160 ft). Imzadi 1979  19:49, 2 October 2012 (UTC)
... which gives you the same thing as {{convert|50|m|ft|adj=on|disp=x|-long (|)}}. JIMp talk·cont 23:46, 2 October 2012 (UTC)

Template:Convert/testcases/bytype/mass

For Template:Convert/testcases/bytype/mass fix {{convert/testcases/test|type=mass|toonly=yes|unit=g oz}} etc (and others) Peter Horn User talk 00:27, 4 October 2012 (UTC)

that would be a typo in the "g oz" template, which should use "multi2" instead of "mulit2". Frietjes (talk) 16:01, 4 October 2012 (UTC)

Conversions of troy ounce

For Bingham Canyon Mine#Operations an appropriate conversion of troy ounce. Peter Horn User talk 00:33, 4 October 2012 (UTC)

400,000 troy ounces (14 short tons; 12 long tons). Frietjes (talk) 15:42, 4 October 2012 (UTC)
Thanks 400,000 troy ounces (12.4 t) also works. Peter Horn User talk 15:09, 5 October 2012 (UTC)
three hundred thousand short tons (270,000 long tons; 270,000 t) or 300,000 short tons (272,000 t; 268,000 long tons) instead of 300 thousand short tons (270 kt or 270 thousand long tons)? Peter Horn User talk 15:45, 5 October 2012 (UTC)
Just checking 400,000 troy ounces (13.7 short tons; 12.2 long tons) Peter Horn User talk 16:07, 5 October 2012 (UTC)
this now works, 400 thousand troy ounces (13.7 short tons; 12.2 long tons). Frietjes (talk) 17:29, 5 October 2012 (UTC)

Converting US gallons/hour

For EMD MRS-1, consumption = 50 gal/h (42 imp gal/h; 190 L/h) and/or 50 US gal/h (42 imp gal/h; 190 L/h) Peter Horn User talk 15:03, 5 October 2012 (UTC)

created. check it with 50 US gal (42 imp gal; 190 L). Frietjes (talk) 15:49, 5 October 2012 (UTC)

Another rail gauge

For Dublin tramways#Dublin and Lucan Steam Tramway and Dublin and Lucan tramway#Closure 62+3/16in or 62.1875 instead of 5 ft 2+316 in (1,580 mm) gauge. Peter Horn User talk 01:27, 6 October 2012 (UTC)

Never mind, we'll go with 63 gaugeGauge. Peter Horn User talk 01:52, 6 October 2012 (UTC) Peter Horn User talk 02:08, 6 October 2012 (UTC)
There is also Track gauge in Ireland
I'll re post this at template talk:RailGauge where it should have been in the first place. Peter Horn User talk 16:14, 9 October 2012 (UTC)

Broken plurals for multiple less-than-one decimal values

{{convert|0.1|to|0.2|m}}

gives

0.1 to 0.2 metres (3.9 in to 7.9 in)

According to the template documentation and the MOS, plural units are supposed to be invoked for all values unequal to 1, i.e. the above should have been "0.1 to 0.2 metres (4 in to 8 in)". {{convert|0.2|m}} correctly gives "0.2 metres (7.9 in)". Can someone familiar with the template fix this please? --125.25.3.30 (talk) 07:30, 11 October 2012 (UTC)

Done. JIMp talk·cont 23:35, 11 October 2012 (UTC)

Fuel consumption

For Scooter (motorcycle)#Italy - Vespa and Lambretta, 160–180 mpgUS or 1.5–1.3 L/100 km or 190–220 mpgimp instead of 160 mpgUS (1.5 L/100 km; 190 mpgimp) - 180 mpgUS (1.3 L/100 km; 220 mpgimp). In addition |disp=or |disp=/ and disp=s do not work in the second set. L/100 km should also link back to Fuel economy in automobiles#Units of measure? Peter Horn User talk 01:32, 9 October 2012 (UTC)

I s'pose linking "L/100 km" to "Fuel economy in automobiles#Units of measure" would make sense. Of course, now you have all three linking to the same so you might as well use lk=in. Please forget about disp=/ and disp=s. It never was a good idea to use a symbol which usually means division (i.e. "per") when appearing alongside of numbers and/or units (in fact this conversion gives a good example of why slashes ought to be depricated, "160–180 mpg-US/1.5–1.3 L/100 km/190–220 mpg-imp", yuck). Okay, it's all done. Note, though, that the positions of the "or" and the semicolon (which should be a comma) should be switched. This is a much trickier problem; I'm working on it. JIMp talk·cont 00:50, 10 October 2012 (UTC)
For M62 locomotive, |consumption = 340 kg/h (750 lb/h) instead of |consumption = 340 kg/hour Peter Horn User talk 02:58, 13 October 2012 (UTC)

Conversion of PS

For DRG Kleinlokomotive Class I 40 PS (29 kW)*. 40 PS (29 kW) works. Peter Horn User talk 00:39, 14 October 2012 (UTC)

How about 40 PS or 29 kW? "40 PS/29 kW" looks like 40 PS divided by 29 kW. JIMp talk·cont 23:03, 14 October 2012 (UTC)

Digit separators

The use of digit separators to form numbers such as 12,345.00 can lead international readers to confusion, as described in Decimal_mark#Digit_grouping. One example is in Geostationary_orbit, where readers can be lead to understand that the Geostationary orbit altiude is a little over 35 kilometers, when it is, in fact, 35 thousand kilometers.

Is it possible to enforce the use of a non-breaking space as thousands separator, as recommended in SI/ISO 31-0 standard?[1] Making that the default would be optimal.

Thanks! SnowRaptor (talk) 17:12, 8 October 2012 (UTC)

  1. ^ "Decimals Score a Point on International Standards". 2006-11-22. Retrieved 2008-11-27.
I have been intending to add thin spaces as thousands separators as an option. Whether it should be the default is another question. The default of this template should be the standard format as layed down by the MOSNUM guidelines. MOSNUM says "In scientific articles, particularly those directed to an expert readership, numbers may be delimited with thin spaces ..." and goes on to mention the use of thin spaces in engineering and mathematical contexts. There is no explicite proscription of the use of thin spaces outside these contexts but it does seem to imply that commas are to be the norm in general articles. The issue has been discussed as few times at WT:MOSNUM but feel free to dust the topic off again and see whether we can get thin spaces as the prefered format for all articles. As for me, I actually prefer thin spaces to commas and so would be happy to see this even though the template coding is a whole heap more difficult. JIMp talk·cont 00:03, 10 October 2012 (UTC)
As it stands, {{convert}} is already rather expensive. The insertion of commas into values is done using the {{formatnum:}} parser function; but there is no equivalent parser function which would insert spaces (thin or otherwise), therefore the coding would need to be done with the existing string manipulation templates, most of which are expensive and could well push {{convert}} over the template limits. --Redrose64 (talk) 13:23, 10 October 2012 (UTC)
Very true, another good reason not to make this the default; JIMp talk·cont 23:37, 11 October 2012 (UTC)
  • Each article can use Convert/gaps when needed: Only use Template:Convert/gaps (from February 2011) where needed to clear confusion. Other users had suggested that "thin-space" or gapped digits would be better for many numbers; however, it depends on specific calculations which might be confusing, such as "35.000" but not so much for "35.00" which is clearly 35 with 2 decimal zeroes (".00"). Use where needed:
  • {{convert/gaps |35000|km|mi}} → {{convert/gaps |35000|km|mi}}
  • {{convert/gaps |35.0011|km|mi}} → {{convert/gaps |35.0011|km|mi}}
  • {{convert/gaps |35E7|km|mi}} → {{convert/gaps |35E7|km|mi}}
  • {{convert/gaps |0.00045314|cm|in}} → {{convert/gaps |0.00045314|cm|in}}
Because Template:Convert/gaps is a "wrapper template" outside of Convert, then Convert was kept as efficient as before, while the huge complexity of gap arithmetic was layered around Convert, similar to Template:Convert/spell which might have been impossible to write as an inside feature of Convert, but works well as a wrapper template. -Wikid77 (talk) 03:13, 17 October 2012 (UTC)

Redirecting {{convert/usgal}} etc. to {{convert/USgal}} etc.

Various subtemplates for US customary units which use lower-case us have been redirected to their upper-case US counterparts. This means that the code usgal/h, for example, gives the same output as the code USgal/h. This is at odds with the old system whereby the lower-case codes linked the dotting of "US" with the sp parameter.

This old feature, however, I don't believe was ever widely known nor do I believe it was ever even mentioned on the doc page. There is some logic to it, I guess, since "U.S." is more common in the US but it really isn't that obvious. USgal vs U.S.gal was always more straight forward and seems to be what users have prefered to use. It might be suggested that this feature means we can get by with fewer subtemplates (usgal doing the jobs of both USgal and U.S.gal) but this isn't true: usgal would give you "190 litres (50 US gal)" or "190 liters (50 U.S. gal)" but not "190 liters (50 US gal)" nor "190 litres (50 U.S. gal)".

We now, though, have an inconsistancy in the coding. Some of these lower-case us codes still have the old feature whilst others are just the same as upper-case US codes. To make things consistant we could replace these new redirects with the code to support the old feature but I don't see much use in that. Alternatively we could depricate the old feature and replace those few remaining subtemplates with the old code with redirects. The seems to me to be the way to go. JIMp talk·cont 06:37, 15 October 2012 (UTC)

I recreated one of these redirects after finding it was still the default target unit for another template. I'm not sure which one now ... it does seem more logical to have "U.S.gal" or "U.S. gal" create the dotted version, if that is necessary at all. no pressing need to recreate the old undocumented features. Frietjes (talk) 15:41, 15 October 2012 (UTC)
  • Other editors use sp=us: The most-obvious case is really "litres" versus "liters" then consider gallons:
  • {{convert|99|l|usgal}} → 99 litres (26 US gal)
  • {{convert|99|l|usgal|sp=us}} → 99 liters (26 U.S. gal) <failed>
  • {{convert|99|l|U.S.gal|sp=us}} → 99 liters (26 U.S. gal)
  • {{convert|99|l|U.S.gal|sp=en}} → 99 liters (26 U.S. gal)* <failed>
However, at some point, many editors just do not notice the details any longer. When they notice, then just tell them to hand-code the result as "26 U.S. gal" or such. Meanwhile, we can begin looking at Lua script modules to quickly add intelligent formatting to conversions. -Wikid77 (talk) 03:52, 17 October 2012 (UTC)

Another pressure unit conversion

For DRG Class 04#History 156.9 to 245.1 N/cm2 (227.6 to 355.5 psi) Peter Horn User talk 19:17, 17 October 2012 (UTC)

try 156.9 to 245.1 N/cm2 (227.6 to 355.5 psi) for now. Frietjes (talk) 19:26, 17 October 2012 (UTC)
Also for DRG Class 24#History, Thanx. Peter Horn User talk 19:43, 17 October 2012 (UTC)
Why not multiply by 10 and specify kilopascal? 1,569 to 2,451 kPa (227.6 to 355.5 psi) --Redrose64 (talk) 20:05, 17 October 2012 (UTC)

X reference

Add {{Convinfobox}} as a cross reference. Peter Horn User talk 15:35, 22 October 2012 (UTC)