Jump to content

Template talk:Convert/Archive June 2010

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


New Convert/num for faster fractions

I have created a new Convert subtemplate, {{Convert/num}}, which displays the same number+fraction amounts, but uses only 2 subtemplates (rather than 4 subtemplates) to handle all types of fractions. Compare:

{{convert/numdisp|2/7}} → 27
{{convert/num|2/7}}       → User:Wikid77/Template:Convert/num
{{convert/numdisp|-38-4/5}} → −3845
{{convert/num|-38-4/5}}       → User:Wikid77/Template:Convert/num
{{convert/numdisp| 76+88/99}} → 76 8899
{{convert/num| 76+88/99}}       → User:Wikid77/Template:Convert/num
{{convert/numdisp| 44/99}} → 4499
{{convert/num| 44/99}}       → User:Wikid77/Template:Convert/num

At some point, when the testing seems complete, we can replace the contents of {Convert/numdisp} from {Convert/num}, to bypass the 2 extra number-display subtemplates (Convert/numdisp/a and Convert/numdisp/frac1), in hundreds of articles . -Wikid77 (talk) 17:16, 29 May 2010 (UTC)

Interesting. It appears as though there is still a desire to retain the unicode versions when they are available (see here). Plastikspork ―Œ(talk) 01:29, 2 June 2010 (UTC)

DMS2Deg in see also section

I replaced {{DMS2Deg}} in the see also section because it substantially duplicates {{Decdeg}} and it has a bug for values between 0° and -0°59'59". –droll [chat] 22:12, 1 June 2010 (UTC)

P.S. Disclaimer: I created {{Decdeg}}. –droll [chat] 22:30, 1 June 2010 (UTC)

Which one is right?

Which one is right? 22 mm (0.866 in) or 0.865 in (22 mm) thereverse of one the other does not entirely coincide. Peter Horn User talk 15:02, 31 May 2010 (UTC)

Ref: Template talk:RailGauge#Discrepencies Peter Horn User talk 15:10, 31 May 2010 (UTC)
You have to compare with like with like and specify an appropriate number of digits:
  • {{convert|22|mm|in|3}} 22 mm (0.866 in)
  • {{convert|0.865|in|mm|0}} 0.865 in (22 mm)
  • {{convert|0.865|in|mm|1}} 0.865 in (22.0 mm)
  • {{convert|0.865|in|mm|2}} 0.865 in (21.97 mm)
  • {{convert|0.865|in|mm|3}} 0.865 in (21.971 mm)
  • {{convert|0.866|in|mm|0}} 0.866 in (22 mm)
  • {{convert|0.866|in|mm|1}} 0.866 in (22.0 mm)
  • {{convert|0.866|in|mm|2}} 0.866 in (22.00 mm)
  • {{convert|0.866|in|mm|3}} 0.866 in (21.996 mm)
-- Dr Greg  talk  15:28, 31 May 2010 (UTC)
Well, the conversion from inches to millimetres is exact in that 1 inch equals 25.4 mm EXACTLY. However, you have to keep in mind that one of the measures is the original, and one is the converted value. If you start converting back and forth, you can introduce conversion creep, so always start from the original value and only convert it into the other system ONCE. A good rule of thumb is to add one more significant figure to the converted value so you don't lose any precision.
0.865 in (21.97 mm)
0.866 in (22.00 mm)
22 mm (0.866 in) RockyMtnGuy (talk) 05:37, 1 June 2010 (UTC)

It is not always easy to determine what was the original value, however your explantion makes sense. Peter Horn User talk 16:02, 3 June 2010 (UTC)

Rounding these windspeed conversion to the rearest 5 mph or 5 km/h

Rounding these conversion to the rearest 5 mph or km/h 285 km/h (180 mph) or 175 mph (280 km/h)/180 mph (290 km/h) as the case may be, would that be possible? This would be to fill a technical need for the windspeed article and all the cyclone huricane and tornado articles. For a sample see Talk:Cyclone Gonu#Wind speeds and convert Peter Horn User talk 21:03, 5 June 2010 (UTC)

Possible, yes, easy ... well ... JIMp talk·cont 09:28, 7 June 2010 (UTC)
  • The 5-unit rounding, for a single option, might be easy, but people would typically later complain they couldn't use that rounding for special options, such as when adj=on & lk=out for Imperial units. At this point, it is easier to hard-code the calculation amounts for special rounding (as {{#expr: (amt * factor / 5 round 0) * 5}}, where "5" is for 5-unit rounding). In the case of cyclone, hurricane or tornado articles, they are typically forced to quote whatever figures the official weather source reports (even when they are wrong typos, in which case, the corrected value is a hand-converted amount +footnote). The rationale for denying auto-conversions (in weather articles) is because the U.S. National Weather Center (or others) often pre-rounds the data from speed in knots, causing the mph and km/h figures to not match each other, but only match the original 5-unit rounding from knots. When stating a hypothetical windspeed, search for related past storms, and perhaps use those as accurate examples of what speeds could happen in the future: again, 5-unit mph & km/h windspeeds often do not match, because speed is rounded, in 5-unit increments, from windspeed in knots. When a speed conversion is not provided in a weather source, then hand-convert the result (as: amt/5 rounded x 5). I think if Convert tried to round the storm windspeeds, there would be numerous complaints about the results, for years to come. Sometimes, finger-plus-keypad is the best technology to solve a problem. However, if there is a great need, I would create an option as "disp=5" to round by 5-unit amounts. -Wikid77 (talk) 20:53, 8 June 2010 (UTC)

Deepwater Horizon oil spill

In the article Deepwater Horizon oil spill there is a need for volume converting with multiply output values. More particularly, there is a need to show the spill and collection units in oil barrels, US gallons and cubic meters. This template converts oil barrels into US gallons and liters (e.g. {{convert|12000| to|100000|oilbbl|USgal L||abbr=none}} but it does not work if liters are replaced by cubic meters. It also does not works if input value is given in US gallons. Could anybody modify this template to make these conversions possible? The discussion about units is available here. Thank you. Beagel (talk) 18:10, 8 June 2010 (UTC)

  • DONE. I have added a subtemplate to handle "USgal m3" to allow either:
  • {convert|12000| to|100000|oilbbl|USgal L||abbr=none} → 12,000 to 100,000 barrels (500,000 to 4,200,000 US gallons; 1,900,000 to 15,900,000 litres)
  • {convert|12000| to|100000|oilbbl|USgal m3||abbr=none} → 12,000 to 100,000 barrels (500,000 to 4,200,000 US gallons; 1,900 to 15,900 cubic metres)
  • Just m3: {convert|12000|oilbbl|m3} → 12,000 bbl (1,900 m3)
Thank you for suggesting that valuable combination, as: USgal/m3. We don't always think of every common possibility. The talk-page topic was archived, so I have set the new option in that oil-spill article. -Wikid77 (talk) 21:35, 8 June 2010 (UTC)

specific impulse

is there a way to do specific impulse conversion from sec to kn/kg? i don't see it in the list of supported units and it would be useful for the standard infobox on the assorted rocket pages. Seanmcd27 (talk) 17:46, 10 June 2010 (UTC)

Kilonewtons per kilogram is equivalent to metres per second per second so how could we convert from seconds? It seems that there are various different specific impulses, care would have to be taken not to get them confused. 17:53, 11 June 2010 (UTC)

psi & ksi

psi & ksi

  • 1,000 pounds per square inch (7 MPa) exists.
    • 1 kilopound per square inch (7 MPa) needed.

for: A514 steel#A514 A514 steel#A517 Peter Horn User talk 13:54, 14 May 2010 (UTC) Peter Horn User talk 23:54, 14 May 2010 (UTC)

Is ksi kilopounds (force) per square inch? JIMp talk·cont 15:33, 18 May 2010 (UTC)
Could be either one, but see where the link ksi leads you because that is the one I'm concerned with. Peter Horn User talk 20:43, 24 May 2010 (UTC)
Okay ksi will give you kilopounds (force) per square inch. JIMp talk·cont 23:51, 14 June 2010 (UTC)
Thanks, Peter Horn User talk 00:55, 15 June 2010 (UTC)

Basal area

There's a need for a conversion between the metric and English units used to express basal area– that is, between ft2 ac-1 and m2 ha-1. The conversion factors are:

  • m2 ha-1 * 4.355 = ft2 ac-1
  • ft2 ac-1 * 0.230 = m2 ha-1

As per here. I'd do it myself but I don't think I have the technical expertise. Much appreciated. Minnecologies (talk) 03:06, 13 June 2010 (UTC)

Done. Use the codes m2/ha and sqft/acre
1.0000 square metre per hectare (4.356 sq ft/acre)
1.0000 square foot per acre (0.2296 m2/ha)
JIMp talk·cont 23:47, 14 June 2010 (UTC)

Adjective + abbreviation

How do I use both properties? The abbreviation parameter overrides the adjective parameter. - ʄɭoʏɗiaɲ τ ¢ 16:58, 14 June 2010 (UTC)

You don't. The abbreviation parameter is meant to override the adjective parameter. This is in accordance with Wikipedia's guidelines. JIMp talk·cont 23:22, 14 June 2010 (UTC)

Some wikipedians don't like conversion templates

Some wikis don't like conversion templates. See User talk:Peter Horn/Archive 2#Templates for their "arguments" and "reasons". I'm all for them becase the use avoids conversion errors that often occur when the conversion is done on a calculator, or worse yet on a slide rule, outside of Wikipedia. Peter Horn User talk 20:51, 24 May 2010 (UTC)

A prime example for the need can be found at Talk:Ship#Conversions Peter Horn User talk 15:58, 3 June 2010 (UTC)

In Banksia prionotes#Response to fire "longhand conversions" 265 °C (510 °F), 330 °C (625 °F), 340 °C (645 °F) and 500 °C (930 °F) compared to 265 °C (509 °F), 330 °C (626 °F), 340 °C (644 °F) and 500 °C (932 °F). The latter were rolled back. However, note the dicrepencies. This is the reason why template:conversion should be used. Peter Horn User talk 01:55, 15 June 2010 (UTC)

You don't understand significant figures. The former conversions are much better. Hesperian 02:37, 15 June 2010 (UTC)
Just testing: 265 °C (510 °F), 330 °C (630 °F) or 330 °C (626 °F), 340 °C (640 °F) or 340 °C (644 °F) and 500 °C (930 °F). I posted a new request at Template talk:Convert#Rounding temperature conversions to the nearest 5° below. Peter Horn User talk 22:30, 15 June 2010 (UTC)

Different separators

I recall there being a parameter to change the standard separator from parentheses to "/", but it seems to have disappeared from the documentation. Has the feature been removed or is it just not documented? The kind of thing I'm looking for is to change the standard "1 mile (1.6 km)" to "1 mile/1.6 km" so I can use the conversion inside an already parenthesised piece of text. Astronaut (talk) 06:34, 16 June 2010 (UTC)

Why not use disp=or e.g 1 mi or 1.6 km instead? A slash looks too much like a division. JIMp talk·cont 08:33, 16 June 2010 (UTC)
Ah.. I was looking for something like sep=slash and didn't notice the disp=s parameter. Anyway, it doesn't matter now; I found a way to reword without using the parenthesised text. Thanks all the same though. Astronaut (talk) 11:11, 16 June 2010 (UTC)

Rounding temperature conversions to the nearest 5°

Would it be possible to round temperature conversions to the nearest 5 °C or 5 °F? Peter Horn User talk 22:25, 15 June 2010 (UTC) Fixed typo. Peter Horn User talk 22:27, 15 June 2010 (UTC)

  • As a proof of concept, I created Template:Convert/LoffAoffD5SoffT which allows option "disp=5" (numeral five) to round temperature by 5-unit amounts. Some examples:
{{convert|100|C|F}}           → 100 °C (212 °F).
{{convert|100|C|F|disp=5}} → 100 °C (210 °F)*.
{{convert|101|C|F}}           → 101 °C (214 °F).
{{convert|101|C|F|disp=5}} → 101 °C (215 °F)*.
{{convert|191|C|F}}           → 191 °C (376 °F).
{{convert|191|C|F|disp=5}} → 191 °C (375 °F)*.
{{convert|1930|C|F|0}}           → 1,930 °C (3,506 °F).
{{convert|1930|C|F|0|disp=5}} → 1,930 °C (3,506 °F)*.
High temperatures ending in "0" typically round to nearest 10, so add parameter "|0" to calculate whole degrees, before rounding by 5. I understand rounding by 5 can be useful, but we need to consider the long-term complications, so this "disp=5" is a limited option to analyze the various usage issues. -Wikid77 (talk) 05:49, 18 June 2010 (UTC)

Error giving carriage return before parenthesis

Hi

there seems to be a problem with the conversion used on the Deepwater disaster page

The conversion seems to have placed a carriage return just before the closing parenthesis.

Can someone have a look and try and fix it please

Thanks...Chaosdruid (talk) 08:07, 15 June 2010 (UTC)

I can't see any<br /> in the page source that would do this, nor in fact on my browser they symptom you describe. Can you pin down which conversion? It could just be that a &nbsp; might be needed instead of a breaking space, are you sure it is right before the closing parenthesis, or is it between the number and the unit? (Or is it a dimensionless unit?) Si Trew (talk) 07:35, 16 June 2010 (UTC)
Sorry, I'd already fixed it but hadn't got round to mentioning it here. JIMp talk·cont 08:29, 16 June 2010 (UTC)
Treat that as a beta test then! Thanks Jimp. Si Trew (talk) 15:31, 18 June 2010 (UTC)

Route kilometres and route miles

Is it possible to convert route kilometres to route miles (and vice versa), i.e. as used on transport systems (and usually distinguished from track miles on railways with multiple tracks?) Of course the conversion is the same as for km to/from mile, is it possible to change the displayed labels? Otherwise it leads me to need rather unnatural rewording (this time in Old Rouen tramway), or of course a hand-conversion (not difficult I know). I can never get the hang of those display= options, help would be appreciated. Si Trew (talk) 12:55, 18 June 2010 (UTC)

Passenger miles might also fall under this. I don't know whether passenger kilometres are widely used worldwide, considering that air and sea routes are generally measured in nautical miles and this unit of measure tends to be used more within the industry than to the general public. Si Trew (talk) 15:41, 18 June 2010 (UTC)

convert kcal to kilojoules

In Ton#Ton of TNT a convert for 1 kcal, 4.184 kilojoules Peter Horn User talk 00:53, 15 June 2010 (UTC)

1 kcal (4.184 kJ) ... JIMp talk·cont 10:45, 15 June 2010 (UTC)

Additional conversions

Peter Horn User talk 23:56, 16 June 2010 (UTC)

BTU per hour is done ...
... but I'm not so sure about the calorie units. The template has supported the megacalorie for about three years and there is currently only one transclusion. JIMp talk·cont 08:00, 20 June 2010 (UTC)
For Gas compressor#Staged compression. This works 343 atm (34,754 kPa; 5,041 psi) but 343 atm (35 MPa; 5 ksi) might be more appropriate. Peter Horn User talk 20:09, 28 June 2010 (UTC)

Tweeking needed

Compare 3 in (76 mm), 3 in (76.2 mm), 3 in (76 mm) and 3 in (76 mm). Could the last one be adjusted some way to give a 75 mm output instead of 76 mm, perhaps with |disp=5| ? Peter Horn User talk 15:07, 25 June 2010 (UTC)

Make that the first one & the last two with |disp=5|. Peter Horn User talk 15:14, 25 June 2010 (UTC)
Similarly have 36 in (914 mm), 36 in (914 mm), 3 ft (914 mm), 3 ft (914 mm) be giving an output of 915 mm instead of 914 mm by the use of |disp=5|. Peter Horn User talk 15:22, 25 June 2010 (UTC)
{convert|36|in|mm|sigfig=3|abbr=on|disp=5} → 36 in (914 mm)*
{convert|36|in|mm|sigfig=3|abbr=on|disp=b} → 36 in (914 mm)
Full unit names required creating other subtemplates (Template:Convert/LoffAoffD5Soff to support "disp=5" when abbr=off) and for abbr=none:
{convert|3|in|mm|abbr=off|disp=5}   → 3 inches (75 millimetres)*
{convert|3|in|mm|abbr=none|disp=5} → 3 inches (75 millimetres)*
Perhaps there should be a parameter "inc=5" to avoid using disp=5 in the long-term redesign with more features for Convert. -Wikid77 23:04, 26 June 2010 (UTC)
Whatever gets the job done..."inc=5" (increments) seems OK, including temperature converts. Peter Horn User talk 20:13, 28 June 2010 (UTC)
Peter, after our previous exchanges on the subject of rounding in 5's, I am pleased to see you are following up with a request here. I think it may help if I explain why it would be a good idea. I have two reasons, roughly appropriate precision and reader comfort. For example, where an item is being described in inches and fractions but its nature is such that the measurement is fairly imprecise, a conversion to the nearest 1 mm may give an inappropriate impression of precision, while the nearest 10 mm could be too vague. Think, for example, of a rough-sawn piece of wood, or a cocktail onion. Giving the conversion to the nearest 5 mm would often give the right feel. More subtly, an appropriate degree of precision in conversion minimises the tiny interruption in the flow of thought caused by having to interpret it. In the right context, say, '25 mm' or '65mm' is 'got' more quickly than '23 mm' or '67 mm'. Where the context makes both 1x and 10x seem out of place, the discomfiture caused by the disjunction is the greater, and could often be alleviated by a half-decade rounding option. I am not sure how far this effect extends: I see '1650 mm' as easier than '1630 mm', but not much, while '20.4 mm' seems no more time consuming to grasp than '20.5'. I am also not sure of the extent to which I am describing a personal or a common response. The style manual does not seem to advise on appropriate numerical precision (I don't have a spare month to read the archive). Globbet (talk) 22:21, 29 June 2010 (UTC)