Template talk:Convert/Archive April 2012
{{talkarchive}}
kBar→psi conversion seems to be incorrect
:Unless I'm completely misunderstanding things, a barye is not a bar. According to the main page Barye 1 Ba is 10^-6 bar, so 4 kBa is 4 mbar. Taking a bar as 15 psi, that is 15/250 = 3/50 = 0.06 psi which agrees with the template. Martin of Sheffield (talk) 17:42, 5 April 2012 (UTC)
::Ok, thanks. I think I understand what I need to do. Obviously, I never use Barye or bar, and I'm an idiot about it. I appreciate your clarification. SkepticalRaptor (talk) 05:23, 6 April 2012 (UTC)
convert metres to yards '''''and''''' feet
For the infoboxes of the Montreal Metro stations: {{convert|1281.69|m|ydft|abbr=off}} or even {{convert|1281.69|m|ydftin|abbr=off}} instead of just {{convert|1281.69|m|yd|abbr=off}} similar to |depth= {{convert|13|m|ftin|abbr=off}}. Peter Horn User talk 01:13, 2 April 2012 (UTC)
:Is the use of centimetre precision appropriate to the context? Globbet (talk) 22:44, 4 April 2012 (UTC)
::Appopriate or not, this is the way the interstation distances were given right from the start of the articles implicated including List of Montreal Metro stations. So let us leave well enough alone. Peter Horn User talk 18:01, 9 April 2012 (UTC)
Remove leading zero
Please add an option to remove the leading zero for values < 1. So that "{{convert|1|mm|cm|abbr=values}}" is "1 (.10)". --John S. Peterson (talk) 04:42, 6 April 2012 (UTC)
- Currently, editors must hand-code conversions with special numeric formatting. For years, the Wikipedia Manual of Style, in WP:MOSNUM, has stated to keep the leading zero on decimal values less than one. For that reason, an intense debate might occur when removing the lead "0". -Wikid77 (talk) 11:07, 8 April 2012 (UTC)
:Only Americans would favour the removal of the leading zero. If there are any pharmacists among the Wiki users they would be able to tell you that the lack of a leading zero and a weak decimal point on prescriptions has lead to deadly overdosages. At any rate, metric usage dictates the use of a leading zero. Peter Horn User talk 19:25, 9 April 2012 (UTC)
tonnes, long and short tons with abbr
When doing triple conversions with tonnes, abbr=on and abbr=in don't work as they should (abbr=out and abbr=off do, the former maybe only as it's the default). Abbr=in may just be a case of missing templates, but abbr=on is not abbreviating the input units.
{{convert|220|LT|t ST|abbr=in}} → {{convert|220|LT|t ST|abbr=in}}{{convert|220|LT|t ST|abbr=out}} → {{convert|220|LT|t ST|abbr=out}}{{convert|220|LT|t ST|abbr=on}} → {{convert|220|LT|t ST|abbr=on}}{{convert|220|LT|t ST|abbr=off}} → {{convert|220|LT|t ST|abbr=off}}{{convert|220|ST|t LT|abbr=in}} → {{convert|220|ST|t LT|abbr=in}}{{convert|220|ST|t LT|abbr=out}} → {{convert|220|ST|t LT|abbr=out}}{{convert|220|ST|t LT|abbr=on}} → {{convert|220|ST|t LT|abbr=on}}{{convert|220|ST|t LT|abbr=off}} → {{convert|220|ST|t LT|abbr=off}}{{convert|220|t|ST LT|abbr=in}} → {{convert|220|t|ST LT|abbr=in}}{{convert|220|t|ST LT|abbr=out}} → {{convert|220|t|ST LT|abbr=out}}{{convert|220|t|ST LT|abbr=on}} → {{convert|220|t|ST LT|abbr=on}}{{convert|220|t|ST LT|abbr=off}} → {{convert|220|t|ST LT|abbr=off}}
Thryduulf (talk) 11:09, 6 April 2012 (UTC)
: I fixed the redlinks, but I thought there was some reason that we never abbreviate LT and ST. I will try to look it up in the archives. Frietjes (talk) 19:42, 6 April 2012 (UTC)
:: I found this thread. Frietjes (talk) 19:48, 6 April 2012 (UTC)
::: Hmm, MOSNUM does say they should always be spelled out in full (given the previous discussion linked to I don't understand why, but that's another issue). However {{temp|convert}} should be consistent - at the moment abbreviations are allowed when the input is long tons but not in other circumstances. Thryduulf (talk) 18:20, 7 April 2012 (UTC)
::::These subtemplates predate the MOSNUM rule. Most have been corrected to conform. JIMp talk·cont 23:56, 8 April 2012 (UTC)
Kilometres per hour per second to miles per hour per second
For Montreal Metro#Bombardier Transportation MR-73: {{convert|5.2|km/h/s|mph/s|abbr=on|disp=or}} and/or {{convert|5.2|km/h/s|mi/h/s|abbr=on|disp=or}} instead of (5.2 km/h or 3.2 mph per second). Peter Horn User talk 18:06, 9 April 2012 (UTC)
:Ditto for Montreal Metro#Canadian Vickers MR-63 and MR-63, {{convert|4.8|km/h/s|mi/h/s|abbr=on|disp=or}} instead of 4.8 km/h/s or 3.0 mph/s. Peter Horn User talk 19:16, 9 April 2012 (UTC)
::According to MOSNUM "There should be no more than one slash per compound unit symbol (e.g., {{xt|kg/(m·s)}}, not {{!xt|kg/m/s}} or {{!xt|kg/m·s}})." JIMp talk·cont 00:46, 10 April 2012 (UTC)
:So {{convert|4.8|km/h/s|mph/s|abbr=on|disp=or}} Peter Horn User talk 18:15, 10 April 2012 (UTC) Peter Horn User talk 18:19, 10 April 2012 (UTC)
::The use of mph/s is a real bastardised unit of measure. How does the literature represent it using imperial units? and in metric units? If the literature does not use both hours and seconds in metric units, then neither should we. Martinvl (talk) 10:14, 11 April 2012 (UTC)
new combination output request: ft mi
I could use a conversion from meters both to feet and to miles (for part of [http://en.wikipedia.org/w/index.php?title=Challenger_Deep&diff=prev&oldid=486623371 this edit], in which I dropped a miles part). I took a stab at User:JHunterJ/Convert/ft mi, but I don't know how to verify it. Help? -- JHunterJ (talk) 14:02, 10 April 2012 (UTC)
- DONE. Those 2-unit outputs can only be tested as live templates, so I copied to Template:Convert/ft_mi. Your markup was close to working, but I had to copy similar 2-unit markup from Convert/km_mi to get the calculation to work. Then, tested by:
:* {{convert|1609.344|m|ft mi}} → {{convert|1609.344|m|ft mi}}
:* {{convert|16,093.44|m|ft mi}} → {{convert|16,093.44|m|ft mi}}
: I suppose we need to expand Help:Convert to describe how to write a similar 2-unit output subtemplate for Convert's multi-conversions. -Wikid77 (talk) 09:32, 12 April 2012 (UTC)
::Thanks! Worked like a charm. -- JHunterJ (talk) 11:44, 12 April 2012 (UTC)
Additional words in template output
How do I make the template output "328.54 competitive kilometres (204.15 miles)"? I tried doing
{{convert|328.54|competitive|km|miles}} and {{convert|328.54|km|miles|adj=mid|competitive}}
The first way broke the template, and the second way produced
- {{convert|328.54|km|miles|adj=mid|competitive}}
I tried doing
{{convert|328.54|km|miles|adj=mid|competitive kilometres|abbr=values}}
but that resulted in extra km
- {{convert|328.54|km|miles|adj=mid|competitive kilometres|abbr=values}}
Any suggestions appreciated, thanks, Matthewedwards : Chat 22:32, 14 April 2012 (UTC)
- DONE. Sorry for the late reply. Try adj=pre, as follows:
::* {{convert|328.54|km|miles|adj=pre|competitive}} → {{convert|328.54|km|miles|adj=pre|competitive}}
: Other people asked for similar, so that is why we have that. -Wikid77 (talk) 09:38, 17 April 2012 (UTC)
convert/spell with ft and in
The {{temp|convert/spell}} template doesn't seem to work with input in feet and inches (needed for Goliath#Goliath's height). Mostly this seems to be just one missing template (Template:Convert/LoffAcommaDoutput number onlySoff2), but specifying the output units and using the "words=out" parameter gives a big red error.
{{convert/spell|6|ft|7|in}} → {{convert|spell=in|6|ft|7|in}}{{convert/spell|6|ft|7|in|words=out}} → {{convert|spell=on|6|ft|7|in}}{{convert/spell|6|ft|7|in|m}} → {{convert|spell=in|6|ft|7|in|m}}{{convert/spell|6|ft|7|in|case=u}} → {{convert|spell=In|6|ft|7|in}}{{convert/spell|6|ft|7|in|m|case=u}} → {{convert|spell=In|6|ft|7|in|m}}{{convert/spell|6|ft|7|in|m|words=out}} → {{convert|spell=on|6|ft|7|in|m}}{{convert/spell|6|ft|7|in|m|words=out|case=u}} → {{convert|spell=On|6|ft|7|in|m}}
Thryduulf (talk) 09:42, 15 April 2012 (UTC)
The same happens with stones and pounds, but that is missing template:Convert/multi2LoffAonSoffu2 when trying to get the second unit name. See user:Thryduulf/Conversion sandbox#Convert/spell with ft and in. 82.132.211.152 (talk) 10:05, 15 April 2012 (UTC)
- PARTLY DONE. I have Convert/spell working for ft-in with some options, so far:
:*
: The corrections have involved many very complex small changes, so I will fix other options later. -Wikid77 (talk) 16:26, 17 April 2012 (UTC)
::Thank you. Although I note there is a discrepancy between the conversions between the numerical and word outputs (2.01m vs 2.00m). I'm guessing this will be a rounding error?
:Separetly, I'm not sure "two point zero zero metres" is the best we can do, but that's a separate, sylistic issue. Thryduulf (talk) 18:28, 17 April 2012 (UTC)
- ROUND RESULT BY |0. In Convert/spell, the option "|0" can be used to round the result to a whole amount:
:*
:*
: I will check on the internal rounding of 2.01 versus 2.00. -Wikid77 21:39, 17 April 2012 (UTC)
grams/mile to grams/km
For some of the automobile articles we need to convert grams of {{CO2}} per mile to grams per km and vice-versa. Is there a way to do this? There may or may not be a need to add ounces per mile to the mix. Stepho talk 08:11, 20 April 2012 (UTC)
:Grams of {{chem|CO|2}} per kilometre to ounces of {{chem|CO|2}} per mile is possible. I'll add gCO2/mi. Codes: gCO2/km
, gCO2/mi
and ozCO2/mi
. JIMp talk·cont 08:30, 20 April 2012 (UTC)
:Done. Feel free to change the gCO2/km default from ozCO2/mi to gCO2/mi if that makes more sense. (Go to {{tl|convert/gCO2/km}} and edit the o=ozCO2/mi
to read o=gCO2/mi
). JIMp talk·cont 08:42, 20 April 2012 (UTC)
overriding unit name on output (with multiple unit conversions)
In many space-related articles, sources give distances in nautical miles, and the articles reflect that; this has caused some confusion. An example is in Apollo 8. That spacecraft went past the moon and had a maximum distance in a number of nautical miles (203,752) that is substantially less than the number of statute miles (235,000 or so) that commonly cited as the distance to the moon. Yes, they're different units, but it does result in some head-scratching as someone looks at the figure and thinks "that can't be right."
The solution we have now is:
:
which generates:
:203,752 nautical miles (234,474 miles; 377,349 kilometers)
But the use of the unqualified "miles" after "nautical miles" is confusing. What we'd really like to see it produce is:
:203,752 nautical miles (234,474 statute miles; 377,349 kilometers)
Is there a way to do this? If not, can "statute miles" be added as a new unit, treated substantially the same as "miles" except for its output? (Note: see also Lightmouse's comment here.) TJRC (talk) 19:32, 25 April 2012 (UTC)
:Adding statue miles as a new unit would be the easiest solution. JIMp talk·cont 00:08, 26 April 2012 (UTC)
:How about statmi
for statute miles?
::{{convert|203752|nmi|statmi km|abbr=off|sp=us
}} → "{{convert|203752|nmi|statmi km|abbr=off|sp=us}}"
:JIMp talk·cont 02:38, 26 April 2012 (UTC)
::I see what [http://en.wikipedia.org/w/index.php?title=Template%3AConvert%2Fstatmi_km&diff=489254012&oldid=296856881 you did] there... Thanks, you rock, it's now [http://en.wikipedia.org/w/index.php?title=Apollo_8&diff=489269094&oldid=488912399 in use] and looks much nicer. TJRC (talk) 05:28, 26 April 2012 (UTC)
Convert/spell with US gallons
For Canada's Wonderland#Timeline {{convert|spell=in|2000000|usgal|m3|0}} instead of {{convert|2000000|usgal|m3|0}} Or how was it that one shortens the 2,000,000 to 2 million? Peter Horn User talk 02:22, 19 April 2012 (UTC)
:You could use e6usgal
to get "{{convert|2|e6USgal|m3}}" if you're okay with "2" as opposed to "two". JIMp talk·cont 03:23, 19 April 2012 (UTC)
::I'm OK with that, but still, "convert/spell" would be an interesting alternative option. Peter Horn User talk 13:45, 19 April 2012 (UTC)
:::Yes, it would. JIMp talk·cont 23:17, 19 April 2012 (UTC)
- Changing Convert/spell to avoid "Acomma" subtemplates: When I expanded Template:Convert/spell to show words for the output amount, I did not realize the impact of "abbr=comma" to require so many new subtemplates to handle that option. I will change Convert/spell to use {formatnum:2,333|R} to remove commas, and thereby avoid the need for subtemplates named with "Acomma". -Wikid77 13:16, 22 April 2012 (UTC)
- DONE - Convert/spell supports more units: With today's changes, now US gallons can be used in Convert/spell:
::• {{convert/spell|2000000|usgal|m3|0}} → {{convert|spell=in|2000000|usgal|m3|0}}
::• {{convert/spell|651|usgal|L}} → {{convert|spell=in|651|usgal|L}}
: It took me a while (months) to realize that "abbr=comma" had been complicating the use of various other types of units. -Wikid77 12:33, 27 April 2012 (UTC)
How to include mph
For Stairlift#Travel speed how to include miles per hour in {{convert|0.07|m/s|ft/min|2|abbr=off}} 0.07 metres per second {0.16 miles per hour) and {{convert|0.15|m/s|ft/min|2|abbr=off}} (0.34 miles per hour). Peter Horn User talk 00:53, 29 April 2012 (UTC)
- For custom combinations, use disp=out: There are often rare mixtures of output units, so just combine the first output as "disp=out" and then use "disp=out" for the 2nd unit, followed by ")" to end. For example:
::* 0.15 metres per second ({{convert|0.15|m/s|ft/min|2|disp=out}};{{convert|0.15|m/s|mph|2|disp=out}})
→ 0.15 metres per second ({{convert|0.15|m/s|ft/min|2|disp=out}}; {{convert|0.15|m/s|mph|2|disp=out}})
: Be sure to put "(" and space after the semicolon "; " when formatting the 2 combined output units. The newer option "disp=out" shortens the markup, compared to the older option "disp=output only". Again, there is a lot of flexibility of the output format when using disp=out. -Wikid77 (talk) 03:44, 29 April 2012 (UTC)
Horsepower
For IC3#Technical Overview {{Convert|298|kW|bhp mthp|abbr=on}} instead of {{convert|298|kW|bhp|abbr=on|lk=on}} or 405 metric hp. I just keep on finding new ones. Peter Horn User talk 22:38, 26 April 2012 (UTC)
:Also for IC4#Equipment and specifications. Peter Horn User talk 01:34, 27 April 2012 (UTC)
::Make that {{Convert|298|kW|bhp hpM|abbr=on}} instead. Peter Horn User talk 01:54, 27 April 2012 (UTC)
::The template is using "PS" (output abbr & input code) for metric horsepower. It might not be ideal (since it's from the German "Pferdestärke" and since it's ambiguous with petasiemens) but at least it's recognised. bhp PS
doesn't currently exist but I'm wondering whether we really need convert to metric horsepower. JIMp talk·cont 03:37, 27 April 2012 (UTC)
:It appears in those articles, but for now I'll go with PS and put (Metric horse power in brackets). Peter Horn User talk 23:48, 28 April 2012 (UTC)
::Neither {{convert|298|kW|bhp PS|abbr=on|lk=on}} nor {{convert|298|kW|hp PS|abbr=on|lk=on}} work. {{convert|298|kW|bhp ps|abbr=on|lk=on}} nor {{convert|298|kW|hp ps|abbr=on|lk=on}} do not work either. Peter Horn User talk 14:06, 30 April 2012 (UTC)
Conversion problem
I'm having a problem when converting long tons to tonnes:
- {{convert|225|LT|t}}
- {{convert|249|LT|t}}
- {{convert|250|LT|t}}
- {{convert|251|LT|t}}
- {{convert|255|LT|t}}
The conversion for 250 long tons is currently showing as (250 t) .
Thanks Edgepedia (talk) 11:47, 30 April 2012 (UTC)
Ok, answer myself, this needs to be {{convert|250|LT|t|0}}; its a prescion problem. Edgepedia (talk) 11:52, 30 April 2012 (UTC)