Template talk:Convert/Archive April 2012
This is an archive of past discussions about Template:Convert. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
kBar→psi conversion seems to be incorrect
{{convert|4|kBa|psi}} provides an incorrect result. The template gives this result: 4 kilobaryes (0.058 psi). But the real result should be 4kBa = 58,000 psi. If I'm doing something wrong, please point it out, because I'd like to get this right. SkepticalRaptor (talk) 17:30, 5 April 2012 (UTC)
- 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: 1,281.69 metres (1,401 yards 2.0 feet) or even 1,281.69 metres (1,401 yards 2 feet 0 inches) instead of just 1,281.69 metres (1,401.67 yards) similar to |depth= 13 metres (42 feet 8 inches). 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 "1 (0.10)" 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}} → 220 long tons (220 tonnes; 250 short tons)
- {{convert|220|LT|t ST|abbr=out}} → 220 long tons (220 t; 250 short tons)
- {{convert|220|LT|t ST|abbr=on}} → 220 long tons (220 t; 250 short tons)
- {{convert|220|LT|t ST|abbr=off}} → 220 long tons (220 tonnes; 250 short tons)
- {{convert|220|ST|t LT|abbr=in}} → 220 short tons (200 tonnes; 200 long tons)
- {{convert|220|ST|t LT|abbr=out}} → 220 short tons (200 t; 200 long tons)
- {{convert|220|ST|t LT|abbr=on}} → 220 short tons (200 t; 200 long tons)
- {{convert|220|ST|t LT|abbr=off}} → 220 short tons (200 tonnes; 200 long tons)
- {{convert|220|t|ST LT|abbr=in}} → 220 t (240 short tons; 220 long tons)
- {{convert|220|t|ST LT|abbr=out}} → 220 tonnes (240 short tons; 220 long tons)
- {{convert|220|t|ST LT|abbr=on}} → 220 t (240 short tons; 220 long tons)
- {{convert|220|t|ST LT|abbr=off}} → 220 tonnes (240 short tons; 220 long tons)
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 {{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)
- 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 {{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)
- I found this thread. Frietjes (talk) 19:48, 6 April 2012 (UTC)
Kilometres per hour per second to miles per hour per second
For Montreal Metro#Bombardier Transportation MR-73: 5.2 km/(h⋅s) or 3.2 mph/s and/or 5.2 km/(h⋅s) or 3.2 mph/s 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, 4.8 km/(h⋅s) or 3.0 mph/s 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., kg/(m·s), not kg/m/s or kg/m·s)." JIMp talk·cont 00:46, 10 April 2012 (UTC)
- So 4.8 km/(h⋅s) or 3.0 mph/s 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 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}} → 1,609.344 metres (5,280.00 ft; 1.000000 mi)
- {{convert|16,093.44|m|ft mi}} → 16,093.44 metres (52,800.0 ft; 10.00000 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
- 328.54-kilometre competitive (204.15-mile)
I tried doing
{{convert|328.54|km|miles|adj=mid|competitive kilometres|abbr=values}}
but that resulted in extra km
- 328.54 (204.15)
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}} → 328.54 competitive kilometres (204.15 miles)
- 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 {{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}} → six feet seven inches (2.01 m)
- {{convert/spell|6|ft|7|in|words=out}} → six feet seven inches (two point zero one metres)
- {{convert/spell|6|ft|7|in|m}} → six feet seven inches (2.01 m)
- {{convert/spell|6|ft|7|in|case=u}} → Six feet seven inches (2.01 m)
- {{convert/spell|6|ft|7|in|m|case=u}} → Six feet seven inches (2.01 m)
- {{convert/spell|6|ft|7|in|m|words=out}} → six feet seven inches (two point zero one metres)
- {{convert/spell|6|ft|7|in|m|words=out|case=u}} → Six feet seven inches (two point zero one metres)
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:
- {{convert/spell|21|ft|7|in}} → twenty-one feet seven inches (6.58 m)
- 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:
- {{convert/spell|6|ft|7|in|m|words=out}} → Six feet seven inches (two point zero one metres)
- {{convert/spell|6|ft|7|in|m|words=out|0}} → Six feet seven inches (two metres)
- 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 CO
2 per kilometre to ounces of CO
2 per mile is possible. I'll add gCO2/mi. Codes:gCO2/km
,gCO2/mi
andozCO2/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 {{convert/gCO2/km}} and edit the
o=ozCO2/mi
to reado=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:
- {{convert |203752 |nmi |mi km |abbr=off |sp=us}}
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
}} → "203,752 nautical miles ([convert: unknown unit])"
- {{
- JIMp talk·cont 02:38, 26 April 2012 (UTC)
- I see what you did there... Thanks, you rock, it's now in use and looks much nicer. TJRC (talk) 05:28, 26 April 2012 (UTC)
Convert/spell with US gallons
For Canada's Wonderland#Timeline two million US gallons (7,571 m3) instead of 2,000,000 US gallons (7,571 m3) 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 "2 million US gallons (7,600 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)
- 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)
- 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}} → two million US gallons (7,571 m3)
- • {{convert/spell|651|usgal|L}} → six hundred and fifty-one US gallons (2,460 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 0.07 metres per second (13.78 feet per minute) 0.07 metres per second {0.16 miles per hour) and 0.15 metres per second (29.53 feet per minute) (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 (29.53 ft/min; 0.34 mph)
- 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 298 kW ([convert: unknown unit]) instead of 298 kW (400 bhp) 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 298 kW ([convert: unknown unit]) 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 298 kW (400 bhp; 405 PS) nor 298 kW (400 hp; 405 PS) work. 298 kW ([convert: unknown unit]) nor 298 kW ([convert: unknown unit]) 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:
- 225 long tons (229 t)
- 249 long tons (253 t)
- 250 long tons (250 t)
- 251 long tons (255 t)
- 255 long tons (259 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 250 long tons (254 t); its a prescion problem. Edgepedia (talk) 11:52, 30 April 2012 (UTC)