Template talk:Convert/Archive April 2010

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

Rounding billions as 10-digit

30-March-10: I have begun a new rounding routine, as {{rndpad}} to keep billions with all 10 digits, not as "1E9". In the past, we have discussed simplifying the typical "23 subtemplates" needed to handle each of many conversions. Also, the current rounding has been using scientific notation for numbers in the billions, which might be a problem where 10 (or more) digits are actually needed. Examples:

  • {{rnd|1700500.782|1}}   →   1,700,500.8
  • {{rnd|1600000400.682|1}}   →   1.6000004007×109
  • {{rnd|1600000400.682|2}}   →   1.60000040068×109
  • {{rndpad|1700500.782|1}}   →   1700Expression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operator
  • {{rndpad|1600000400.682|1}}   →   1600000Expression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operator
  • {{rndpad|1600000400.682|2}}   →   1600000Expression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operatorExpression error: Unexpected < operator

The rounding for negative amounts is limited to -2 in {rndpad}:

  • {{rnd|2400000676.682|-2}}   →   2.4000007×109
  • {{rndpad|2400000676.682|-2}}   →   2400000700

This is just the beginning of discussions about rounding with 10 digits for amounts in the billions, to consider the idea. -Wikid77 10:37, 30 March 2010 (UTC)

  1. Why do you perceive some problem "where 10 (or more) digits are actually needed"? It seems to give the proper precision above, no different from your proposal, for anything with 8 or more significant digits..
  2. Where would you ever imagine a case "where 10 (or more) digits are actually needed" in a Wikipedia article?
  3. There are no "negative amounts" involved in what you discuss as "rounding for negative amounts", other than a left of the decimal point "negative".
  4. What do you mean by "limited to -2" in any case:
{{rnd|1700250000|-5}}   →   1.7003×109
{{rndpad|1700250000|-5}}   →   1700300000
The 10-digit display is limited to rounding at -2, and hence rounding at -5 gives "1.7003" which is not 10 digits. -Wikid77
Take another stab at trying to describe what you are trying to accomplish. Gene Nygaard (talk) 15:15, 31 March 2010 (UTC)
  • Some editors might want the result of a conversion as full billions, not with 109 or 1E+9. For example:
{{convert|90,000|mi|ft}} gives: 90,000 miles (480,000,000 ft)
{{convert|9,000,000|mi|ft}} gives: 9,000,000 miles (4.8×1010 ft)
However, using {{rndpad|...}} would give: 9,000,000 miles as {{rndpad|48000000000|0}} ft.
I think the best use might be in tables, where over 900 million might be mixed with billions, expected as 10-digit form. Yet, if anyone wanted any result as 10-digit form, then it could be provided. Currently, MediaWiki calculations will round as follows:
{{#expr: 5280 * 90000}} gives: 475200000
{{#expr: 5280 * 900000}} gives: 4752000000
Those are some reasons to show 10-digit form. -Wikid77 (talk) 10:04, 1 April 2010 (UTC)
Setting aside for now the question of whether this is a good idea (or whether it should ever default to anything other than listing all the digits), I guess the next question now would be how you would implement this in using the template. Or, would it be better to instead introduce a parameter that could express the output in either scientific notation or engineering notation, or both at the editor's option? What are the options here? Gene Nygaard (talk) 02:23, 2 April 2010 (UTC)

Adjective phrases involving a unit of measurement - e.g. 340-metre-high cone

The article Sunset Crater contains "the 340 metres (1,115 ft)-high cone". This is imperfect. If "adj=on" is used, we can get "the 340-metre (1,115 ft)-high cone", still somewhat short of the mark. If another parameter could be used to insert "high", as in "adj=on|drivel=high", then the template could produce "the 340-metre-high (1,115 ft) cone", and I would have a smile a mile (1.609km) wide. ;-) Is this an occasion where the best result should be hand-coded, or is there another solution using Convert that I haven't found? I often see situations like this. Chris the speller (talk) 20:44, 29 March 2010 (UTC)

Right now, the only option is "{{convert|340|m|adj=on}}", with the standardised output of "340-metre (1,120 ft) high wall". There should be no dash between the parenthetical and 'high'. Perhaps some new functionality can be added when Wikid rewrites the template, but nothing for now. Huntster (t @ c) 23:33, 29 March 2010 (UTC)
The good new is that the template, unlike Chris the speller, always puts that space in before the unit symbol in accordance with our long-standing house rules ("1.609km"). Why does an experienced user like you, Chris, have so much problem following a simple rule? Gene Nygaard (talk) 15:19, 31 March 2010 (UTC)
Gene, that's uncivil edging on a personal attack, and over such a trivial thing. Huntster (t @ c) 03:16, 1 April 2010 (UTC)
  • Prepare to have a smile, 1-mile wide (1.6 km). Fortunately, we had discussed this issue weeks ago, so I have implemented new option "adj=mid" to insert mid-text (parameter 4) between the input and output. The mid-text can be multiple words and can contain hyphens (or spaces):
  • {{convert|340|m|ft|adj=mid|-high}}   →   340-metre-high (1,120 ft)
  • {{convert|340|m|ft|adj=mid|-high cone}}   →   340-metre-high cone (1,120 ft)
  • {{convert|43|km|mi|adj=mid|-wide}}   →   43-kilometre-wide (27 mi)
  • {{convert|6|ft|m|adj=mid|-radius circle}}   →   6-foot-radius circle (1.8 m)
You must specify the output unit. Sorry this option took so long to add, but template Convert is so complex, it's a mind-fry to connect all these options and predict their impact. Bear in mind that this mid-text insertion will seem like magic to many users, because there is no limit to the text inserted, which could be other conversions inside conversions:
  • they climbed a {{convert|3200|ft|m|adj=mid|-high slope up the mountain}}.
                                  →  they climbed a 3,200-foot-high slope up the mountain (980 m).
  • {{convert|4|royal cubit|m|adj=mid|-square [[Egyptian pyramid]]}}
                                        →   4-royal-cubit-square Egyptian pyramid (2.1 m)
  • {{convert|4|royal cubit|m|adj=mid|-square [[Egyptian pyramid]], width {{convert|2|m|ft|disp=output only}} }}
                                        →   4-royal-cubit-square Egyptian pyramid, width 6.6 ft (2.1 m)
Please update many articles, as needed. -Wikid77 09:36, 30 March 2010
Very wide smile! You have provided even more than I asked for. Thank you thank you thank you! Sadly, zero as a fourth parameter, as in {{convert|6.4|km|mi|0|sp=us|adj=mid|-long lava flow}} only gets outputted appended to the text, and does not influence the rounding. In this case, I have gotten around it by using "sigfig=1". I hate to prolong your mind-fry. Chris the speller (talk) 15:04, 30 March 2010 (UTC)
  • Put the rounding parameter at the end: "|0 }}". -Wikid77
Wow, that's impressive Wikid, creating the functionality that quickly. Though even before I read Chris' reply, I got worried that having an unnamed parameter like that might cause problems. Might I suggest requiring a named parameter, like "endtext="? Huntster (t @ c) 21:15, 30 March 2010 (UTC)
It should, of course, be "a smile, 1 mile (2 km) wide" with no hyphens. That's different from "a 1-mile-wide (2 km) smile".
The bigger problem is that using positional parameters with different meanings (here for the "mid" text", but the documented meaning is for positional rounding) is totally unacceptable. Gene Nygaard (talk) 15:28, 31 March 2010 (UTC)
To make my first point clearer, it would also be "a smile, 2 kilometers (1 mi) wide", not only with no hyphens but also with the plural form, even though it would be "a 2-kilometre-wide (1 mi) smile".
Will anybody ever fix the still-broken "sing=on" parameter so that we can get proper singular output?
As it stands now, Wikid77's claim that "you must specify the output unit" isn't actually true; you could also use "a {{convert|1|mi|0|adj=mid|-wide}} smile" to get "a 1-mile-wide (2 km) smile".
Huntster could of course get Chris the speller's "the 340 metres (1,115 ft)-high cone" easily enough; in that case, the hyphen in front of high appears in normal text outside the conversion template. What he might have had in mind is not getting a hyphen after metre from the template. Gene Nygaard (talk) 15:54, 31 March 2010 (UTC)
No, what I had in mind was "the 340-metre-high (1,115 ft) cone". I have "improved" about 80 articles using the new function. Please decide soon whether this is "totally unacceptable". Chris the speller (talk) 04:47, 1 April 2010 (UTC)
That is arguably an improvement, as long as you keep the measurements in front of the noun "cone" when using the adjective form. Many of Wikid77's examples are wrong; they do not do that. For example
  • :* {{convert|4|royal cubit|m|adj=mid|-square [[Egyptian pyramid]]}}
                                        →   4-royal-cubit-square Egyptian pyramid (2.1 m)
In that case, the resulting 2.1 m is no longer a prenominal adjective. If spelled out, it should be "an Egyptian pyramid (2.1 metres square)". It not only dissociates the adjective from the noun "pyramid" but it also dissociates it from the "square" (adjective, adverb, whatever it is characterized as). It looks like it is only dealing with one dimension. It is flat-out wrong.
You need to keep in mind the way people use dual measurements. Most people only use one of them. When you are using the adjective form, whichever one they are reading should come in front of the noun. Note also what happens if abbr=none is used in Wikid77's example:  :* {{convert|4|royal cubit|m|abbr=none|adj=mid|-square [[Egyptian pyramid]]}}
                                    →   4-royal-cubit-square Egyptian pyramid (2.1-metre), which improperly includes a hyphen in front of metre, which doesn't have the proper "s" at the end, and doesn't inform the readers to square that measure. Gene Nygaard (talk) 04:57, 3 April 2010 (UTC)
  • I think it will be "totally" acceptable, once people learn to put the rounding parameter at the end. I realize it would be nice to have a named parameter "mid=zzzz", but that is not practical because a named parameter must be specified (by name) in many of the 2 thousand display subtemplates, and a bot edit could be very difficult because of variations in those 2,000 subtemplates. -Wikid77 (talk) 09:08, 1 April 2010 (UTC)
Like this? What's wrong here?
Default rounding
  • {{convert|6+1/2|and|10|usfloz|mL|adj=on}} → 6+12-and-10-US-fluid-ounce (190 and 300 mL)
Putting round to zero decimal places at the end
  • {{convert|6+1/2|and|10|usfloz|mL|adj=on|0}} → 6+12-and-10-US-fluid-ounce (192 and 296 mL)
  1. Default rounding to 190, then rounding to zero decimal places as 21? What's going on here?
  2. Fractions—what is that + sign doing here? Why don't I get a built-up fractions, as I do for this?
  • {{convert|6+1/2|ft|mm|adj=on}} → 6+12-foot (2,000 mm)
but not for these:
  • {{convert|6+1/2|usfloz|mL|adj=on}} → 6+12-US-fluid-ounce (190 mL)
  • {{convert|6+1/2|and|10|ft|mm|adj=on}} → 6+12-and-10-foot (2,000 and 3,000 mm)
nor this one, which also doesn't work when I put rounding to 0 decimal places at the end
  • {{convert|6+1/2|and|10|ft|mm|adj=on|0}} → 6+12-and-10-foot (1,981 and 3,048 mm)
Gene Nygaard (talk) 02:46, 3 April 2010 (UTC)

Abbr=on does not work

Why does "abbr=on" not work here: (12 to 24 °C (53.6 to 75.2 °F)*)? See geography of Brunei. Peter Horn User talk 16:27, 1 April 2010 (UTC)

  • FIXED. I corrected the handling of abbr=on (which had been forced abbr=off), in {Convert/Dual/LoffAonDsSoffT}. Each combination of temperature-range options invokes a different template, which then sets options to invoke a shared range template, and there are perhaps 150 combinations. Formerly, abbr=off was ignored, but when I implemented "degrees Celsius" then I forgot that all 150 combinations using abbr=off/on then mattered. I will fix the others among those 149 which are also incorrect:
- {{convert|12|to|24|C|F|1|abbr=on|disp=/}} → 12 to 24 °C (53.6 to 75.2 °F)*
- {{convert|12|to|24|C|F|1|disp=/}} → 12 to 24 °C (53.6 to 75.2 °F)*
- {{convert|12|to|24|C|F|1|disp=or}} → 12 to 24 °C or 53.6 to 75.2 °F
Thanks for reporting the problem: having 3,200 Convert subtemplates, we need all the help we can get in pinpointing the numerous problems. -Wikid77 06:21, 2 April 2010 (UTC)
  • Partly because they make these do things they weren't meant to do. Note that abbr=off doesn't work in {{convert|12|C|F|1|abbr=off|disp=/}} either: 12 degrees Celsius (53.6 degrees Fahrenheit)*.
Gene Nygaard (talk) 02:05, 2 April 2010 (UTC)
Then there is the really bizarre, such as "abbr=comma" which has nothing whatsoever to do with whether or not unit symbols are used:
{{convert|12|to|24|C|F|1|abbr=comma|disp=/}} →

{{convert|12|to|24|C|F|1|abbr=comma|disp=/}}

{{convert|12|C|F|1|abbr=comma|disp=/}} → {{convert|12|C|F|1|abbr=comma|disp=/}}
{{convert|12|ft|m|0|abbr=comma|disp=/}} → {{convert|12|ft|m|0|abbr=comma|disp=/}}
{{convert|54321|ft|m|0|abbr=comma|disp=/}} → {{convert|54321|ft|m|0|abbr=comma|disp=/}}
{{convert|12|ft|m|0|abbr=comma}} → {{convert|12|ft|m|0|abbr=comma}}
{{convert|54321|ft|m|0|abbr=comma}} → {{convert|54321|ft|m|0|abbr=comma}}
Gene Nygaard (talk) 02:18, 2 April 2010 (UTC)
  • Very few of the total "74,000" possible combinations of options have been implemented. -Wikid77 06:21, 2 April 2010 (UTC)
That's a pretty significant problem, isn't it?
It's one of the main reasons this template is totally lacking a consistent look and feel. Gene Nygaard (talk) 02:48, 3 April 2010 (UTC)
  • We're able to survive due to the 80/20 Rule, where, in the case of Convert, 97% of typical functionality is provided by 3% of all possible subtemplates. If a user activates a very rare set of options, such as adj=mid, disp=or, and lk=in, then there is probably no subtemplate to handle those combined options. I'm not sure that is much of a problem, compared to the complexity to support all possible options, and use that in a table of 100 rows, by 4 columns, listing 400 conversions and hoping they can all be processed in one page. -Wikid77 (talk) 18:43, 3 April 2010 (UTC)

Option to use square brackets, rather than ordinary brackets

Looking over this talkpage, I hestitate to suggest adding further complexity, but for cases where units are used in quoted text, it might be nice to be able to output the conversion surrounded by square brackets, rather than ordinary brackets. I was just doing some tidying up on Mick Mannock, where the convert template had been inserted into the oirignal citation for his VC, which per WP:MOSQUOTE is probably "a bad thing" - but if the template could use square brackets instead, which is the usual convention for editorial emendations, it would probably be OK, and easier than waht I ended up doing to get no-breaking spaces in and so on. David Underdown (talk) 14:32, 3 April 2010 (UTC)

  • Again, please use "disp=output only" which omits parentheses and allows putting editorial brackets "[...]" around the converted result. -Wikid77 18:43, 3 April 2010 (UTC)

Errors on the page

{{Editprotected}} There are several errors, highlighted in bold red, on the Template:Convert page, in particular the {{convert|60|by|120|m|ft}} example in the Range of values section. Could someone who has the rights to edit this protected page please try to fix this. Thanks. Truthanado (talk) 15:31, 3 April 2010 (UTC)

Indeed, that needs fixing. I've disabled the request for now, until someone knows how to fix it. — Martin (MSGJ · talk) 18:06, 3 April 2010 (UTC)
  • Those parser errors might have been due to a recent incorrect revision, but the /doc subpage had not yet been reformatted to use the latest {Convert/by}. I was revising Convert/doc to note that for option adj=mid, put any rounding-parameter after the mid-text. Upon saving Convert/doc, the example for "{convert|60|by|120|m|ft}" worked after reformat, probably due to WP servers having been too busy to update pages fast enough for all the zillions of modified navboxes (which trigger reformatting of thousands of wiki-spammed articles). Navboxaholics are clogging the servers with busy-work to reformat articles using those navboxes. See essay: "WP:Overlink crisis". -Wikid77 18:43, 3 April 2010 (UTC)
The page still shows lots of bold red errors for "{convert|60|by|120|m|ft}" in my browser. If I understand correctly from "WP:Overlink crisis", it might correct itself but it may take days. I'll keep looking... Truthanado (talk) 22:25, 3 April 2010 (UTC)
  • No, I had to remove that example, until I can determine what to change in "{convert|60|by|120|m|ft}" or "{convert|60|xx|120|m|ft}" so that they can be transluded into {Convert}, beyond being in just the subpage {Convert/doc}. There are many subtle problems to avoid, but I will explain the bizarre issue when I get time to fix it. -Wikid77 23:14, 3 April 2010 (UTC)
  • FIXED. The problem seems to be a template-nesting limit, caused when updating {Convert/by} to invoke {Convert/numdisp} on 31-March-2010. For the fix, I changed {Convert/by} to only invoke {Convert/numdisp} for fractions, not for decimals or whole numbers. This is a quirk of the MediaWiki markup language: there is a limit to the number of templates that can be nested within other templates, in templates, in templates, etc. Although, technically, freaking on nested templates is not an "error", it could be considered a "design flaw" in that the markup language does not allow nesting templates 100 levels deep. Kids: Don't do this - don't design a language where the modules can only be nested a few dozen deep. -Wikid77 (talk) 04:49, 4 April 2010 (UTC)

Temperature conversion

In Israel#Geography and climate, (53.7 °C (128.7 °F)*) works, (53.7 °C or 128.7 °F) does not work. Peter Horn User talk 22:43, 4 April 2010 (UTC)

  • I added Template:Convert/LonAoffDorSoffT. -Wikid77 07:10, 5 April 2010 (UTC)

Plan to increase mph precision

20-March-2010: I have created a proposed update to {{Convert/mph}} to show higher precision when a speed ends in zero "0" but still allow auto-rounding for high speeds (in whole hundreds or thousands), such as the Space Shuttle (or low Earth orbit) circa 11,000 km/h. A speed such as 310 km/h would convert as 193 mph (rather than 190 mph), but still auto-round 4,000 km/h as "2,500 mph". See table of proposed values below:

Speed: km/h Default precision Precision as "0" Proposed (sandbox)

290 km/h
295 km/h
300 km/h
305 km/h
310 km/h
309 km/h
311 km/h
300.4 km/h
4000 km/h
11,000 km/h
30,000 km/h

290 km/h (180 mph)
295 km/h (183 mph)
300 km/h (190 mph)
305 km/h (190 mph)
310 km/h (190 mph)
309 km/h (192 mph)
311 km/h (193 mph)
300.4 km/h (186.7 mph)
4,000 km/h (2,500 mph)
11,000 km/h (6,800 mph)
30,000 km/h (19,000 mph)

290 km/h (180 mph)
295 km/h (183 mph)
300 km/h (186 mph)
305 km/h (190 mph)
310 km/h (193 mph)
309 km/h (192 mph)
311 km/h (193 mph)
300.4 km/h (187 mph)
4,000 km/h (2,485 mph)
11,000 km/h (6,835 mph)
30,000 km/h (18,641 mph)

290 km/h ([convert: unknown unit])
295 km/h ([convert: unknown unit])
300 km/h ([convert: unknown unit])
305 km/h ([convert: unknown unit])
310 km/h ([convert: unknown unit])
309 km/h ([convert: unknown unit])
311 km/h ([convert: unknown unit])
300.4 km/h ([convert: unknown unit])
4,000 km/h ([convert: unknown unit])
11,000 km/h ([convert: unknown unit])
30,000 km/h ([convert: unknown unit])

Are there any objections to increasing the precision of mph-conversions by 1 digit for whole-number speeds ending in zero "0"? -Wikid77 13:26, 20 March 2010 (UTC)

Object. Part of it is still my objection to a piecemeal changing of the feet rounding. In that case, I don't think you ever had any consensus for a change, and the last discussion here left it still up in the air. Yet you went and implemented the change anyway.
This is worse. Still piecemeal, but done on a different basis—wreaking further havoc on any chance of achieving a consistent look and feel in this template. It isn't based on any sound reasoning. Gene Nygaard (talk) 18:28, 20 March 2010 (UTC)
To be more specific, there are some problems with your examples.
  1. You failed entirely to mention that the current default rounding adds an extra digit to the results whenever there is only one clearly significant digit in the input. Thus we get 300 km/h going to 190 mph rather than 200 mph, 4,000 km/h going to 2,500 mph rather than 2,000 mph, and 30,000 km/h going to 19,000 mph rather than 20,000 mph.
  2. The 'precision as "0"' column is just plain strange. It isn't helpful. A much better choice, if you want us to be able to see where the rounding takes place, is something like sigfig=6.
That's the main reason why the results are the same for 300 km/h and for 310 km/h. If you want to get rid of that existing rule, you could try to make a case for it. I say it should stay. We could, of course, come up with other examples where two 2-digit numbers convert to the same number, just like 82 °F (28 °C) and 83 °F (28 °C), but that isn't necessarily a bad thing.
  1. The examples which end up with a significant zero at the end are misleading.
  2. You don't clearly show where the difference comes in. This should demonstrate it better:
Speed: km/h Sigfig=5 Default precision Proposed (sandbox)
3.1 1.9263 3.1 km/h (1.9 mph) 3.1 km/h ([convert: unknown unit])
3.10 1.9263 3.10 km/h (1.93 mph) 3.10 km/h ([convert: unknown unit])
310 1.9263 310 km/h (190 mph) 310 km/h ([convert: unknown unit])
3100 1.9263 3,100 km/h (1,900 mph) 3,100 km/h ([convert: unknown unit])
317 196.97 317 km/h (197 mph) 317 km/h ([convert: unknown unit])
3170 1,969.7 3,170 km/h (1,970 mph) 3,170 km/h ([convert: unknown unit])
31700 19,697 31,700 km/h (19,700 mph) 31,700 km/h ([convert: unknown unit])
317000 196,970 317,000 km/h (197,000 mph) 317,000 km/h ([convert: unknown unit])
830 515.74 830 km/h (520 mph) 830 km/h ([convert: unknown unit])
8300 5,157.4 8,300 km/h (5,200 mph) 8,300 km/h ([convert: unknown unit])
140 86.992 140 km/h (87 mph) 140 km/h ([convert: unknown unit])
1400 869.92 1,400 km/h (870 mph) 1,400 km/h ([convert: unknown unit])
You are also likely looking at the wrong end. A more sensible solution would be something like counting the significant digits, but ignoring an initial one in either the input or the output when making that count.
Another problem is that you did not accurately describe what your change does. You described your change as if it depended on the location of the decimal point—as if the results would be different for an input 310 than they are for 3100 or 31,000. But they aren't. In fact, what you are doing is adding an additional digit not only when we start with one significant digit, but also when we start with two significant digits.
But the biggest problem of all is that you don't even make a feeble attempt at any explanation whatsoever as to why speeds in these two units should be treated any different from any other conversions. Gene Nygaard (talk) 19:31, 20 March 2010 (UTC)
Object. It doesn't make sense to treat mph any differently from any other conversion. And changing a well-established default behaviour is bad, because you will effectively modifying possibly thousands of articles to display figures that differ from what the original editor intended them to be. The solution to the Lamborghini Murciélago#Engines problem is for that article to specify the correct precision, not to fiddle with the template. -- Dr Greg  talk  20:57, 20 March 2010 (UTC)

This discussion was again revived below in a third section, #Fix for mph errors, made to look like a new proposal but just a regurgitation of the same one. Gene Nygaard (talk) 13:40, 6 April 2010 (UTC)

Conversion unit Pondemaat

In the Netherlands, an ancient unit of area measurement was the pondemaat (sing & plural). 1 pondemaat = 3,674.363358816 square metres (0.907954959429 acres) We don't need to go that accurate though. 1 pondemaat = 3,674.363 square metres (0.908 acres) is probably enough.

As far as I can see, there will not be a need to convert into pondemaat, but there is a need to convert from pondemaat. Would it be possible to add this into the available conversions? Suggest "pond" would be a good codeword. Mjroots (talk) 07:23, 14 March 2010 (UTC)

Forgot to say, would like conversion to do pondemaat => (ha, acre). Mjroots (talk) 09:58, 14 March 2010 (UTC)
  • Done (revised). Edit Template:Convert/pondemaat to change any parameters. The default output will be square metres, but you can change that by editing "o=m2" to be something else.
{{convert|3674.363|sqm|pondemaat}}   → 3,674.363 square metres (1.000000 pond)
{{convert|10|pondemaat|sqm}}   → 10 pondemaat (37,000 m2)
The plural & singular are both set as "pondemaat". -Wikid77 00:56, 16 March 2010 (revised 12:33, 23 March 2010)
Bad idea. Especially in both the name of the subtemplate and the name of the parameter. Don't you know what a pond (unit) is in English? Gene Nygaard (talk) 15:20, 19 March 2010 (UTC)
Hint:
{{convert|34.7|kp|N|abbr=none}} → 34.7 kiloponds (340 newtons)
{{convert|34700|pond|N|abbr=none}} → 34,700 pondemaat ([convert: unit mismatch])
Gene Nygaard (talk) 15:47, 19 March 2010 (UTC)
More comments
  • I've suggested input-only conversions before. Nobody's acted on it.
  • There needs to be some showing that these conversions will actually be useful on Wikipedia. That should include giving us some reason to believe that the template would ever be used on more than one or two Wikipedia articles not including ones about units of measure or systems of units (we can assume that those articles are frequented by people who know enough about variations in definitions over time and place. I'd say an indication that it would be used in five or more Wikipedia articles would be reasonable.
  • In this particular case, a need to convert a Frisian unit from one Dutch province equal to 240 times the square of 12 Friesland feet (each 326.065 mm) is especially dubious. This Friesland foot is so obscure that it doesn't even warrant a mention at nl:Voet (lengtemaat)#De voet in Nederland. Gene Nygaard (talk) 16:12, 19 March 2010 (UTC)
  • Agreed, and I have move-renamed it into Convert/pondemaat. -Wikid77 12:33, 23 March 2010
That's only a small part of the problem. A bigger problem is that we should not have every damn definition long-obsolete of a foot or a square rod or a thumb or whatever that any little duchy or petty kingdom or whatever has ever invented. It doesn't belong here. Gene Nygaard (talk) 16:04, 23 March 2010 (UTC)
Usefulness? Quite a few records relating to the drainage of polders give their area in nl:pondemaat. As the vast majority of English speakers wouldn't have a clue how big a pondemaat was, the conversion to acres/hectares is entirely within normal convention. Yes, it's restricted to Friesland, but that doesn't mean that we should not have a conversion. I wasn't aware of pond as a unit when I requested that as a shortcut. I would not have made the above request if I did not consider that it would be a useful thing to have. I'm working my way through the list of standing windmills in Friesland, and expect to come across this measurement again. Now that the conversion has been accommodated I can use it in articles. Mjroots (talk) 07:10, 8 April 2010 (UTC)
Trying a conversion - {{convert|1200|pondemaat|ha acre}} 1,200 pondemaat (440 ha; 1,100 acres). Mjroots (talk) 07:15, 8 April 2010 (UTC)
Great! Many thanks for doing this. Just what is needed. ☺ Mjroots (talk) 07:18, 8 April 2010 (UTC)
In answer to Gene Nygaard above, the conversion is currently used in De Jansmolen, Goëngahuizen, Slagdijkstermolen, Finkum, De Hiemerter Mole, Burgwerd, De Klaver, Bolsward, De Oegekloostermolen, Hartwerd and De Modderige Bol, Goëngahuizen. It will also be used in the De Huinsermolen, Húns article which I'm currently working on. Doubtless there will be others to come. Mjroots (talk) 07:38, 8 April 2010 (UTC)

Balance Convert with article work

26-Feb-2010: This is a reminder. Although Convert has numerous problems to be fixed, I want to remind everyone not to obsess about Convert and neglect to work on other articles (or other templates). Convert is currently 10x times better than many high-profile articles. Sort out all priorities. I get saddened when I see highly experienced people dwell on Convert, while I think their knowledge would be better suited to fixing articles, which many people read every day, but few other people could rewrite and explain. Most people learn to avoid over-using Convert, and perhaps they even hand-code some conversions, to keep the focus on expanding various articles. I'm not saying to "let Convert rot" but I worry that people might think they could easily "fix Convert" like easily reforming 2,000 drug addicts in a 28-day program. By all means, help to fix Convert, but don't let your expert knowledge of other subjects get pulled into the Convert black-hole abyss. Convert is a vast contraption with endless problems; see below: #The missing 74,000 subtemplates. -Wikid77, 19:05, 26 February 2010

A sentiment well expressed, and as an omnivore I can kinda agree with. But let the people who serve us with Convert, do that, and the people who serve us elsewhere, do that. All I can say is that when I come here with a problem – a practical problem from a real article I am editing – I am treated here with politeness, intelligence and clarity. All hail Convert! All hail everyone else too!
Si Trew (talk) 22:32, 9 April 2010 (UTC)

Fractions

Can we get support for fractions (particularly of inches) down to /16? I don't know if there's a need for /32, but I've now got a less than impressive line of red text in an infobox. 81.111.114.131 (talk) 18:02, 27 March 2010 (UTC)

  • Convert can be used with fractions in the form "+7/16":
{{convert|43+7/16|km|mi}} →   43+716 kilometres (27.0 mi)
{{convert|43.5|km|mi}}        →   43.5 kilometres (27.0 mi)
{{convert|43+29/32|km|mi}} →   43+2932 kilometres (27.28 mi)
{{convert|43.9|km|mi}}        →   43.9 kilometres (27.3 mi)
{{convert|43|km|mi}}        →   43 kilometres (27 mi)
{{convert|43.000|km|mi}} →   43.000 kilometres (26.719 mi)
{{convert|43.500|km|mi}} →   43.500 kilometres (27.030 mi)
The precision depends on fraction digits. -Wikid77 08:04, 30 March 2010
Could you take a look at the proposal on Template talk:Convert/and/fra1 please? — Martin (MSGJ · talk) 09:50, 30 March 2010 (UTC)
You can use any fractions as input for general conversions (at least any with only a few significant digit integers as numerator and denominator, perhaps much beyond that). I think the problem here results in two-part units as input, such as feet and inches. Does it occur anywhere else? Pounds and ounces? Where does the fix need to be made--is it in the two-part unit conversions? Is this subtemplate only used with those two-part conversions? Why don't they just use the normal fractions used in other conversions?
75 ft 10+34 in (23.1331 m)
75 ft 10+38 in (23.1235 m)
75 ft 10+716 in (23.1251 m)
75 ft 10+717 in (23.1245 m)
10+34 in (0.2731 m)
10+38 in (0.2635 m)
10+716 in (0.2651 m)
10+717 in (0.2645 m)
75 lb 10+716 oz (34.3153 kg)
10+716 oz (0.2959 kg)
Why do these not use the normal fractions used for single-part units? What makes it different for two-part units? Gene Nygaard (talk) 16:26, 31 March 2010 (UTC)
  • The use of fractions in two-part units has been limited up to 7/8, while not allowing the use of 16ths in 2-part units; however, that might be acceptable for now.
  • {{convert|75|lb|10+5/8|oz|kg|abbr=on}} → 75 lb 10+58 oz (34.32 kg)
I will work on an edit-protected request for other fractions later. -Wikid77 22:06, 11 April 2010 (UTC)

Fix for mph errors

04-Apr-2010: Many people have been shocked at the mph amounts. Although the auto-rounding for mph might seem to be acceptable, when considering significant digits, the conversion amounts are sometimes wrong when compared to the measurement limits. A converted amount might be lower or higher than the equivalent low/high bounds for the original rounded measurement. For example, a speed of 330 km/h could be viewed as rounded between 325-335 km/h. Those boundary speeds have the following mph equivalents:

  • {{convert|325|-|335|km/h|mph|0}}   gives: 325–335 km/h (202–208 mph)
  • {{convert|330|km/h|mph}}   gives: 330 km/h (210 mph). ← higher than 202–208?

That is a case of the fatal error, where the rounded amount 330 km/h as 210 mph is wrong, as being greater than the rounded-upper boundary of 335 km/h, which is only 208 mph. It is just plain wrong to have a converted measurement which is 2 units greater than the highest rounded equivalent. For that reason, the precision of other conversions, in the past, has been adjusted to avoid similar glaring errors in the results. How is the problem fixed? The conversion is changed to set the result as mid-way (then rounded) between the low/high boundaries, and hence, that new result is an appropriate rounded equivalent. The new result will be neither lower than the lowest, nor higher than the highest equivalent rounded limits.

The fix, in {{Convert/mph/sandbox}}, will provide correct values for the equivalent results when converting km/h, as shown in the following table, noting 6 errors to fix.

km/h mph (exact) Current Convert Proposed (sandbox) Boundaries
330 205.05249 330 km/h (210 mph) 330 km/h ([convert: unknown unit]) 325–335 km/h (202–208 mph) *outside
As range: 205.1 ± 3.1 mph
337 209.40209 337 km/h (209 mph) 337 km/h ([convert: unknown unit]) 336.5–337.5 km/h (209–210 mph)
As range: 209.4 ± 0.3 mph
340 211.26621 340 km/h (210 mph) 340 km/h ([convert: unknown unit]) 335–345 km/h (208–214 mph)
As range: 211.3 ± 3.1 mph
342 212.50895 342 km/h (213 mph) 342 km/h ([convert: unknown unit]) 341.5–342.5 km/h (212–213 mph)
As range: 212.5 ± 0.3 mph
170 105.633 170 km/h (110 mph) 170 km/h ([convert: unknown unit]) 165–175 km/h (102.5–108.7 mph) *outside
As range: 105.6 ± 3.1 mph
220 136.702 220 km/h (140 mph) 220 km/h ([convert: unknown unit]) 215–225 km/h (133.6–139.8 mph) *outside
As range: 136.7 ± 3.1 mph
250 155.343 250 km/h (160 mph) 250 km/h ([convert: unknown unit]) 245–255 km/h (152.2–158.4 mph) *outside
As range: 155.3 ± 3.1 mph
280 173.984 280 km/h (170 mph) 280 km/h ([convert: unknown unit]) 275–285 km/h (170.9–177.1 mph) *below
As range: 174.0 ± 3.1 mph
360 223.694 360 km/h (220 mph) 360 km/h ([convert: unknown unit]) 355–365 km/h (220.6–226.8 mph) *below
3400 2,112.7 3,400 km/h (2,100 mph) 3,400 km/h ([convert: unknown unit]) 3,350–3,450 km/h (2,082–2,144 mph)
As range: 2,110 ± 30 mph
4000 2,485.5 4,000 km/h (2,500 mph) 4,000 km/h ([convert: unknown unit]) 3,900–4,100 km/h (2,423–2,548 mph)
As range: 2,490 ± 60 mph

Numerous other errors will be avoided by adjusting the precision to keep the results within the low/high rounded boundaries. [I added the "as range" into the table rows.] -Wikid77 (talk) 07:03, 4 April 2010 (revised 6 April)

  • To me, that looks like it'll be a problem for any conversion factor less than 1, for reasons that should be readily apparent. 81.111.114.131 (talk) 17:23, 4 April 2010 (UTC)
Once again, we have a screwball notion that this is something peculiar to kilometers per hour, and an attempt to "fix" something that isn't broken. Enough already. Gene Nygaard (talk) 19:32, 5 April 2010 (UTC)
There is no "mph error" here
In Wikid77's first example, not the the result of 210 mph is also (210±5) mph. It is 205 to 210 mph. That is not "higher than 202–208". There is considerable overlap there.
Furthermore, there is absolutely nothing peculiar to miles per hour. Look at anything else, and you can find similar results:
975 pounds (442.25256 kg)
980 pounds (440 kg)
985 pounds (446.78848 kg)
Let's stop the attempts at piecemeal "fixes" of something that isn't broken. It's fine as it is. In any conversion, there are normally at least two defensible results (more when we don't limit ourselves to decimal rounding), one a little more precise than what we have, and one a little less precise. What the template does now is one of them; in Wikid77's examples, his choice is another of them, but it isn't necessarily a better choice. Leave it as it is. Gene Nygaard (talk) 19:49, 5 April 2010 (UTC)
OTOH, let's look at what 224 mph means, in one of Wikid77's examples. That would be in the [223.5,224.5) range. Between 359.70 and 361.30 km/h. That gives a false sense of precision, compared to the original 360 km/h which is likely to vary by a minimum of 5 km/h from that value. It gives false precision to the results. Like I said before, this is probably in the range of acceptability. But it isn't necessarily better by any stretch of the imagination. Gene Nygaard (talk) 19:55, 5 April 2010 (UTC)
One of the guiding principles should be that those who ignore one set of measurements should get roughly the same information as those who ignore the other. That includes not having a false sense that the numbers are more precise than they really are. Gene Nygaard (talk) 19:56, 5 April 2010 (UTC)
Wikid77 appears to have been deliberately deceptive in describing what his change would do. That is a far bigger problem than the ones mentioned above.
Consider the following current result:
  • {{convert|350|km/h|mph|abbr=on}} → 350 km/h (220 mph)
Here are Wikid77's "high boundary" and "low boundary" in the terminology he uses above
  • 345 km/h (214.37306132 mph)
  • 355 km/h (220.58677324 mph)
The current default rounding to 220 mph is well within those upper and lower limits.
Nonetheless, what do you suppose Wikid77's proposed revision does? Let's take a look:
That is clearly a change. But it is not a change in accordance with the explanations above.
The changes do not act as Wikid77 claimed he did. He probably just came up with a new rationale to try to justify changes he proposed before, and tried to pull the wool over our eyes and make us look like idiots. Gene Nygaard (talk) 20:13, 5 April 2010 (UTC)
In what way is this deceptive? It looks in accordance with the other values in that column to me. It seems eminently sensible that where a conversion factor is closer to 5x10^n than 1x10^n that an extra significant figure is used. Under the current conversions, both 350km/h and 360km/h resolve to 220mph - that cannot be a "defensible" result. 10hp should come out as 7.4kW rather than 7kW (but not 7.44). 81.111.114.131 (talk) 09:39, 6 April 2010 (UTC)

It is deceptive, and deliberately so, because

  1. Wikid77 made a proposal above to change the rounding for miles per hour.
  2. That #Plan to increase mph precision is still on this page, not yet archived.
  3. This proposal claims to have a different basis
  4. This proposal describes the procedures that might be used to adjust based on a "high boundary" and a "low boundary". In other words, it is described not only as a different problem than the one discussed in the section above, but also as one having a different solution.
  5. So I was checking around to see how this solution was different. What I didn't think of before my earlier posting was to look at the edit history of {{convert/mph/sandbox}}. No changes were made there before this new proposal was made. It was just a deliberate attempt to make us think it was something new, while recycling the old proposal which had been resoundingly rejected.
  6. It is quite proper and legitimate for conversions from two different numbers to end up at the same number in the converted units. I've already given the 82 °F and 83 °F both going to 28 °C above. Gene Nygaard (talk) 13:38, 6 April 2010 (UTC)
Aside to 81.111.114.131
You should have used this template rather than relying on your memory. Ten horsepower might go to 7.4 kW, but it will never go to 7.44 kW
  • {{convert|10|hp|2|abbr=on}} → 10 hp (7.46 kW)
  • {{convert|10|hp-metric|2|abbr=on}} → 10 hp (7.35 kW)
Of course, most of the time 10 horsepower, whether English or metric, should indeed be 7 kilowatts. Because this template already defaults to adding an additional digit the results when there is only one clearly significant digit, we need to override the default to get that proper result, since the defaults are: 10 hp (7.5 kW) and 10 hp (7.4 kW)
Also just curious if you are the same editor who refuses to put spaces in front of unit symbols above.
  • It is also really strange that the people designing this template railroaded a proposal through WP:MOSNUM to eliminate the most common symbol for knots, "kt", from Wikipedia because of a strange worry that people might confuse that symbol for speed with a different symbol for an energy unit. Yet they have no qualms about using "hp" to stand for two distinct units. Gene Nygaard (talk) 14:00, 6 April 2010 (UTC)
    • 82°F and 83°F going to 28°C is not really a problem, whereas 820°F and 830°F going to 280°C is less desirable IMO, though examples closer to the 200°F mark would likely be a better illustration. Perhaps it may just be that with speeds in three digits the difference is more jarring. I can't really see why there's a need to match significant figures, when considering using one digit more or fewer may be more sensible, and why the option needs to be specified to generate a sane result. 81.111.114.131 (talk) 17:32, 6 April 2010 (UTC)
  • There are multiple reasons that 330 km/h should not be defaulted as "210 mph". Another reason is to assume that the ±5-unit rounding of speeds is performed above 400 km/h, a speed that few land vehicles would attain. It is an issue of number sense that 10 km/h should not be considered between 5-15 (but rather 9.5-10.5), just as a 10-month break would not be considered as a time span of 5-15 months, or a 10-year-old child as 5-15 years. Only in some rare circumstances should 50 km/h be considered as 50±5. -Wikid77 16:10, 6 April 2010 (UTC)
Could you stick to the point, please. Numbers such as "10" and "50" have absolutely no relevance whatsoever to your proposal. We already choose to give the extra and often unwarranted precision as a default when there is only one significant digit.
More important, why were you trying to pull the fool us? What were those red herrings above—babble about "high/low bounds" and the like, which you did not and never intended to use as part of your rounding scheme? Gene Nygaard (talk) 00:52, 7 April 2010 (UTC)
  • I am emphasizing that there is more than "one point" to consider. However, when you talk of "fool us" or "red herrings" then you risk being excluded from a consensus discussion, based on WP:AGF. A consensus is a unanimous agreement of people acting within the policies of Wikipedia. Someone who accuses others of deception can get excluded, and the consensus will become the agreement of those remaining. -Wikid77 10:30, 7 April 2010 (UTC)
  • Quite to the contrary, Wikid77. I assume good faith. But that is, always has been, and must be a rebuttable presumption. None of the points I raised about the deception here has been disputed. You claimed an entirely different problem, in a new section here, claiming a new solution to the problem. But there was nothing whatsoever new about your proposal. Gene Nygaard (talk) 13:04, 7 April 2010 (UTC)

Errors in 3-digit results

07-April-10: Apparently, the problems noted by other users have been in results of 3 digits (or more), where the 2-digit results have been rounded closer to the traditional conversions. Only when the result is above 99 is there likely to be an over-rounding error.

Compare conversions in the table below:

Amount Result Current Convert Proposed (sandbox) Boundaries
170 km/h 105.633 170 km/h (110 mph) 170 km/h ([convert: unknown unit]) 165–175 km/h (103–109 mph)
As range: 105.6 ± 3.1 mph
160 km/h 99.419 160 km/h (99 mph) 160 km/h ([convert: unknown unit]) 155–165 km/h (96–103 mph)
As range: 99.4 ± 3.1 mph
180 km/h 111.847 180 km/h (110 mph) 180 km/h ([convert: unknown unit]) 175–185 km/h (109–115 mph) (2-digit)
As range: 111.8 ± 3.1 mph
330 km/h 205.052 330 km/h (210 mph) 330 km/h ([convert: unknown unit]) 325–335 km/h (202–208 mph) *outside
As range: 205.1 ± 3.1 mph
360 km/h 223.694 360 km/h (220 mph) 360 km/h ([convert: unknown unit]) 355–365 km/h (221–227 mph) *outside
As range: 223.7 ± 3.1 mph
170 lb 77.111 170 lb (77 kg) 170 lb ([convert: unknown unit]) 165–175 lb (75–79 kg)
As range: 77.1 ± 2.3 kg
210 lb 95.254 210 lb (95 kg) 210 lb ([convert: unknown unit]) 205–215 lb (93–98 kg)
As range: 95.3 ± 2.3 kg
220 lb 99.790 220 lb (100 kg) 220 lb ([convert: unknown unit]) 215–225 lb (98–102 kg)
As range: 99.8 ± 2.3 kg
250 lb 113.398 250 lb (110 kg) 250 lb ([convert: unknown unit]) 245–255 lb (111–116 kg)
As range: 113.4 ± 2.3 kg
300 lb 136.078 300 lb (140 kg) 300 lb ([convert: unknown unit]) 295–305 lb (134–138 kg)
As range: 136.1 ± 2.3 kg
310 lb 140.614 310 lb (140 kg) 310 lb ([convert: unknown unit]) 305–315 lb (138–143 kg)
As range: 140.6 ± 2.3 kg
320 lb 145.150 320 lb (150 kg) 320 lb ([convert: unknown unit]) 315–325 lb (143–147 kg)
As range: 145.1 ± 2.3 kg
330 lb 149.685 330 lb (150 kg) 330 lb ([convert: unknown unit]) 325–335 lb (147–152 kg)
As range: 149.7 ± 2.3 kg
1130 km/h 702.149 1,130 km/h (700 mph) 1,130 km/h ([convert: unknown unit]) 1,125–1,135 km/h (699–705 mph)
As range: 702.1 ± 3.1 mph

Only for results over 99 is there likely to be an over-rounding error. Any 2-digit result is probably free from worry. -Wikid77 10:30, 7 April 2010 (UTC)

First of all, while you may have "three-digit" numbers, don't try to mislead anybody about there being three significant digits in your examples. Those are all quite legitimate and proper results, the ones most likely to be appropriate. If they aren't, you do have the two options to change the precision.
Note Wikid77's results still fall outside the range if you drop the non-significant trailing zero in his examples. He isn't proposing any general "fix" for his imagined problem; if we assume for the sake of argument that the above really were wrong, this would still be wrong too, even after a fix that is not tailored to address the claimed problem:
Amount Result Current Convert Proposed (sandbox) Boundaries
17 km/h 10.5633 17 km/h (11 mph) 17 km/h ([convert: unknown unit]) 16.5–17.5 km/h (10.3–10.9 mph)
As range: 10.6 ± 0.3 mph


But there is another important factor he is glossing over, too. These results from his proposal go in the opposite direction, giving us less precision than the current default rounding:
Amount Result Current Convert Proposed (sandbox) Boundaries
2160 km/h 3476.2 2,160 mph (3,480 km/h) 2,160 mph/sandbox[convert: unknown unit] 2,155–2,165 mph (3,468–3,484 km/h)
As range: 3,476.2 ± 8.0 km/h
3330 km/h 5359.1 3,330 mph (5,360 km/h) 3,330 mph/sandbox[convert: unknown unit] 3,325–3,335 mph (5,351–5,367 km/h)
As range: 5,359.1 ± 8.0 km/h
What about numbers with three significant digits? Four? More? Why is Wikid77 not telling us what his proposal would do with them?
Gene Nygaard (talk) 13:31, 7 April 2010 (UTC)
  • When a result is rounded to whole units, then we discussed using the rounded boundary numbers, as well. Hence, for 17 km/h, within the rounded range 16.5–17.5 km/h (10.3–10.9 mph), the rounded result is upper limit 10.9 rounded, as 11 mph. Using that tactic, then the rounded result is logically close to the boundary numbers, as either bound: 10 or 11 mph, but 11 mph is derived easier. As we discussed with Mt Everest, if the elevation is in metres, then 3 different converted feet are allowed (as all within the rounded range): 8,848 ± 0.5 metres (29,028.9 ± 1.6 ft), with 29,028 & 29,030 ft; however, I think "29,029 ft" is mandated as the official height in feet, but the general idea is that a metre can be rounded to any of the 2 or 3 whole feet within the range. -Wikid77 22:06, 11 April 2010 (UTC)

Summarize what this would do

Wikid77, could you please provide us with a nice, concise but complete summary of what this would do? Just tell us, in a way appropriate for the documentation page, how the rounding for miles per hour would be done, if your proposed change were implemented. When we put this template on an edit page we should be able to know, without saving or previewing it, exactly what the default rounding will do when converting from miles per hour, and what it will do when converting to miles per hour, based on your description of it.

I know this won't be an easy task for you, for a number of reasons which I might explain later. Gene Nygaard (talk) 20:59, 8 April 2010 (UTC)

That doesn't even attempt to address the question I raised here. It is totally, completely, utterly nonresponsive. So I ask again for you to provide us a summary of what your rounding proposal would do. Gene Nygaard (talk) 00:29, 12 April 2010 (UTC)

Can't have adj=on and non-default abbreviations?

In trying to use the convert tempalate to convert from long tons, it seems that you can't have both the adj=on parameter and an abbreviation parameter without an error. I've only tried the following combinations, but they all gave errors: {{convert|400|LT|adj=on}}, {{convert|400|LT|adj=on|abbr=in}}, {{convert|400|LT|adj=on|abbr=none}}, {{convert|400|LT|adj=on|abbr=all}}. The article in question is Lewisham rail crash. Thryduulf (talk) 17:03, 8 April 2010 (UTC)

Use "abbr=on" rather than "abbr=all".
Note that whether or not "adj=on", abbr=in and abbr=out and abbr=none give error messages when the input units are "LT". If abbr= isn't used, or if it is set to either "abbr=on" or "abbr=off" it doesn't give any error messages, but it also doesn't abbreviate the long tons. In the real world, of course, that "t" is the most common symbol for long tons and for short tons as well as for metric tons.
400-long-ton (410 t)
400-long-ton (410-tonne)
400 long tons (410 t)
400 long tons (410 tonnes)
Note also that if the input units are either "MT" or "t", then abbr=none works, whether or not "adj=on", but abbr=in and abbr=out work only when adj=off:
400-metric-ton (390-long-ton; 440-short-ton)
400 t (390-long-ton; 440-short-ton)
400-metric-ton (390-long-ton; 440-short-ton)
400-metric-ton (390-long-ton; 440-short-ton)
400 t (390-long-ton; 440-short-ton)
400 metric tons (390 long tons; 440 short tons)
400 t (390 long tons; 440 short tons)
400 metric tons (390 long tons; 440 short tons)
400 metric tons (390 long tons; 440 short tons)
400 t (390 long tons; 440 short tons)
400-metric-ton (390-long-ton; 440-short-ton)
400 metric tons (390 long tons; 440 short tons)
Note that in these cases, it uses nonstandard symbols for long tons and short tons. Gene Nygaard (talk) 19:46, 8 April 2010 (UTC)
  • I have added subtemplates for abbr=in & abbr=out. -Wikid 22:06, 11 April 2010 (UTC)
Thryduulf's original examples still don't work except with off or on, nor does abbr=out with adj=on.
400-long-ton (410 t)
400-long-ton (410-tonne)
400-long-ton (410-tonne)
400-long-ton (410 t)
400-long-ton (410 t)
Gene Nygaard (talk) 00:18, 12 April 2010 (UTC)

"Disp=output only" blows up acre conversion

No luck with {{convert|300|acre|ha|disp=output only}}. Chris the speller (talk) 04:15, 9 April 2010 (UTC)

  • FIXED. The missing subtemplate has been added:
{{convert|300|acre|ha|disp=output only}} → 120 ha
The unit "acres" uses special non-abbreviated (Na) subtemplates. Thanks for noting this problem. As discussed earlier, there are "74,000 missing subtemplates" (due to the inherent complexity of providing all options), so we depend on people telling us the major options that need to be supported. (We cannot, in reality, add all 74,000 and keep them updated). -Wikid77 22:06, 11 April 2010 (UTC)
Thanks much. There were 55 articles that had cases like "20 more acres", and the first one I looked at also had a sentence starting with a number, as "Two hundred acres are currently available", and both cases can only be properly handled by hard text or by the "output only" parameter, so this is pretty close to being a major option. Cheers! Chris the speller (talk) 01:26, 12 April 2010 (UTC)

List of units and contents list

There would be a Contents list in the documentation page about list of units, to help navigation to sections (length, area, volume...).--Nopetro (talk) 16:12, 10 April 2010 (UTC)

  • I think to use the browser "find" option and search for "volume" or "area" or "square" metres, etc. -Wikid77 22:06, 11 April 2010 (UTC)
The main documentation page has a table of contents. It is the full list of units at Template:Convert/list_of_units which does not. That is presented in tabular form, but the tables could be separated by quantity under normal headers which would make a table of contents. I think it is also possible to construct a table of contents by hand as it is now. How much benefit would it be to do so? Disadvantages? Gene Nygaard (talk) 00:09, 12 April 2010 (UTC)

Another fix for hideous speed errors

11-Apr-09: The problems of auto-rounded speeds have been discussed for months, and seem to include any speed ending in "0". The latest problem has been an aircraft speed record set in the 1940s, displayed as: 1,130 kilometres per hour (700 mph), where the ending "0" (in 1130) triggers the rounding as 700 mph. With round-parameter "|0" the true conversion becomes: 1,130 kilometres per hour (702 mph).

Next Recommendation: For speeds, consider a single end-zero as a significant digit, so that 1130 has four (4) significant speed-digits, but 1100 km/h would have only 2 sig. digits. In effect, the perception of a rounded speed would only occur as even hundreds or thousands, such as 500 km/h; however, we might need special handling for 100, 200, or 300 as being 3 sig. digits. Until this actual example of 1130 km/h, I didn't think numbers above 400 would be mistaken so badly. The 1940s world record speed of 1,130 km/h as "700" rather than "702 mph" had been displayed for years. According to U.S. concepts of number sense, speeds are often considered precise to the last zero "0" unless obviously rounded like the Space Shuttle speed: 7,000 mph (11,000 km/h). -Wikid77 (talk) 22:24, 11 April 2010 (UTC)

What in the world makes you think that a speed measurement made in the 1940s has four significant digits? How was it measured?
Even if it does, what significance does that have on where our default rounding should be? I'd bet that at least 99 times out of 100, the final 0 in 1130 km/h will not be significant. If you know that the 0 is significant in the example you gave, it is quite appropriate for you to adjust the precision of the results, using one of the two methods available in this template. It is not appropriate to change the default rounding to accomplish this. Gene Nygaard (talk) 00:03, 12 April 2010 (UTC)

Singular becomes plural

{{convert|0.9|acre}} displays as "0.9 acres (0.36 ha)", should be "0.9 acre (0.36 ha)", because 0.9 is less than one. Likewise, {{convert|0.3|km|mi}} displays as "0.3 kilometres (0.19 mi)".--BillFlis (talk) 10:21, 9 April 2010 (UTC)

  • For now, use abbr=out: {{convert|0.9|acre|abbr=out}} as 0.9 acres (0.36 ha). I think some people feel that decimals are always plural, but fractions such as 1/2 would be singular: 12 acre (0.20 ha). -Wikid77 22:24, 11 April 2010 (UTC)
And other people know better, so thanks for letting us get 0.5 acre (0.2 ha) too (with proper override of default rounding).
But the bigger problem are these continual violations of a consistent look and feel, with these piecemeal patches applicable to only some units, with these ludicrous uses of parameters to accomplish something other than their designed purpose, thus precluding their use for their intended purpose, or the use of that parameter with any other values to accomplish the desired singulars.
Another problem is that it still doesn't work with
  • 0.9 kelvins (1.620 °R) (this has atrocious default rounding, too)
and you can find many Wikipedia articles using singular with decimal fractions for this unit, such as activated carbon and thermistor and Donald Eigler and persistent current (which also uses 0.3 micrometer).
Furthermore, even though nobody has ever argued in favor of the plural form for common fractions, this problem has never been fixed for them and still fails to give singular results when you do not use this hokey slap-on patchwork. We still get these results
  • 34 inch (19 millimetres)
  • 34 inch (19 millimetres)
  • 34 inch (19 mm)
Why hasn't that been fixed? Why couldn't you simply use the sing=on parameter for this purpose? Gene Nygaard (talk) 19:24, 12 April 2010 (UTC)


They've been aware of this problem for ages, and have refused to fix it. That's despite the fact that they already have a broken parameter "sing=on" which doesn't work properly, sticking in hyphens:
0.9-acre (0.36 ha)
0.3-kilometre (0.19 mi)
Gene Nygaard (talk) 13:24, 9 April 2010 (UTC)
Though it isn't going to be as evident, it doesn't work in the other direction (for output) either:
{{convert|1.6|lb|kg|abbr=none}} → 1.6 pounds (0.73 kilograms)
{{convert|1.6|lb|kg|abbr=none|sing=out}} → 1.6 pounds (0.73 kilograms)*
Gene Nygaard (talk) 13:57, 9 April 2010 (UTC)

Adjective form with a range of values is not properly spaced and hyphenated

                                                  Result: added "adj=mos" as option for ranges.

"Fred uses {{convert|8|or|10|ft|m|adj=on}} widths of tar paper" comes out as:

"Fred uses 8-or-10-foot (2.4 or 3.0 m) widths of tar paper"
but a space should be inserted after "8-", and a space should replace the second hyphen:
"Fred uses 8- or 10-foot (2.4 or 3.0 m) widths of tar paper"
I think this should apply to all adjectival uses of "or", "to", "and", "x", but not "-", of course.

If this is a welcome challenge, have fun. If it's an unwanted mind-fry, let it go; I haven't seen many of these, maybe only one or two that I can remember, and if I'm not seeing many, probably very few editors are. We could just document another exception in the "Range of values" section. Chris the speller (talk) 00:19, 14 April 2010 (UTC)

I agree. I never had liked the looks of them, but hadn't stopped to figure out what was wrong. I'd think this would be an easy fix for those who can find it.
But not for "x" (I think usually rendered as × in the output), though for "by". Gene Nygaard (talk) 05:47, 14 April 2010 (UTC)
  • The use of hyphens is actually a matter of interpretation, but might follow some common idioms for how phrases often appear. For example, first consider hyphenated colors, to show multiple options:
- The leaves had both yellow- and blue-green colors.
- The leaves had both yellow-green and blue-green colors.
- It was a red-and-white box with a red-white-and-blue flag.
- The flags had 2 color schemes, as reddish-white and blue flags.
I think you can see, now, where the interpretation will change the hyphens:
- The red or white boards were either 8- or 10-foot boards.
- The red-and-white boards were in the pile of 8-or-10-foot boards.
- The boards varied, but were all 8-to-10-foot boards; none 7.
- One was a 10-by-0.5-foot board, as a 120-by-6-inch size.
Consequently, I just don't see any reason to change the hyphens, but perhaps there could be a help-page discussing the above usage of hyphens, and recommend hand-editing for other placement of hyphens. -Wikid77 (talk) 07:30, 14 April 2010 (UTC)
The convert results are like putting two more hyphens in your second example:
The leaves had both yellow-green-and-blue-green colors.
Your first and second examples mean the same thing, but the second is much clearer. But you can't put hyphens around the "and" in addition to the hanging hyphen on the yellow:
The leaves had both yellow--and-blue-green colors. (two hyphens together doesn't work; it's like a dash)
The leaves had both yellow-and-blue-green colors. (one hyphen makes it indistinguishable from "yellow and blue-green colors" which has a different meaning)
Convert also gives us:
the pile of 8-or-10-foot (2.4 or 3.0 m)* boards.
which is wrong on several counts; the "ee" is worse than the hyphenation.
The one thing that might vary is that some people wouldn't use the hanging hyphens in
"Fred uses 8 or 10-foot (2.4 or 3.0 m) widths of tar paper" Gene Nygaard (talk) 10:05, 14 April 2010 (UTC)
While I agree that some might not use the hanging hyphens, WP:MOS clearly specifies them. Nevertheless, one for and two against doesn't look much like a consensus to change the template, and the proper effect can be achieved via "disp=output only", so let's just list another exception in the "Range of values" section:
  • Adjective form of conversions, e.g. "sold in 8- or 10-foot (2.4 or 3.0 m) widths", but "disp=output only" can provide the converted values
Chris the speller (talk) 14:45, 14 April 2010 (UTC)
  • DONE. To match the WP:MOS, we have "adj=mos" to put the hanging hyphens in ranges showing "and/or" (whenever there is a conflict with MOS, we have used abbr=mos, so now adj=mos will match their MOS-style format). Compare examples below:
{{convert|7|and|11|ft|m|adj=on}}               → 7-and-11-foot (2.1 and 3.4 m)
{{convert|8|and|10|ft|m|adj=mos}}            → 8 and 10 feet (2.4 and 3.0 m)*
{{convert|8|or|10|ft|m|adj=mos}}               → 8 or 10 feet (2.4 or 3.0 m)*
{{convert|8|or|10|ft|m|adj=mos|abbr=none}} → 8 or 10 feet (2.4 or 3.0 metres)*
Let me know if they need adjustments, or edit {{Convert/Dual/LoffAoffDbSmos}} or {{Convert/Dual/LoffAnoneDbSmos}} to adjust. -Wikid77 16:10, 17 April 2010 (UTC)
Great news! And it's more useful than I thought at first, as I ran across several more articles yesterday that could use this feature, though I might have trouble finding them now. Thanks very much! Chris the speller (talk) 16:52, 17 April 2010 (UTC)

Knots to mph and km/h

Excuse me for being so forgetful, but how can I get knots to both mph and km/h? To put "x knots (y mph, z kp/h). I don't mind if it is kmh. I think Jim said that the multiple result units are done each-to-each, so perhaps that one is not there (and I am quite happy to have a go at adding it) but I imagine I am doing something silly, as usual.

F'rexample:

{{convert|45|kn|mph|km/h|abbr=on|lk=in}} {{convert|45|kn|km/h|mph|abbr=on|lk=in}} {{convert|45|kn|mph|kph|abbr=on|lk=in}} {{convert|45|kn|kph|mph|abbr=on|lk=in}}

Produces (safety glasses on, please):

45 kn ({{rnd/bExpression error: Unrecognised word "km"|Expression error: Unrecognised word "km"|km/h|Expression error: Unrecognised word "km" }} mph) 45 kn ({{rnd/bExpression error: Unrecognised word "mph"|Expression error: Unrecognised word "mph"|mph|Expression error: Unrecognised word "mph" }} km/h) 45 kn ({{rnd/bExpression error: Unrecognised word "kph"|Expression error: Unrecognised word "kph"|kph|Expression error: Unrecognised word "kph" }} mph) 45 kn ({{rnd/bExpression error: Unrecognised word "mph"|Expression error: Unrecognised word "mph"|mph|Expression error: Unrecognised word "mph" }} km/h)

Thanks, and sorry for a long question to what is no doubt a simple answer. I don't mind being told It Don't Do That, and I will be happy to try to add it as a little more learning of the huge hierarchy of these templates, but if it Do Do That, I am obviously doing something stupidly wrong, and best to find that out first, I think.

Best wishes Si Trew (talk) 22:26, 9 April 2010 (UTC)

It seems that this is the default behaviour when the input is knots. {{convert|45|kn|abbr=on|lk=in}} → 45 kn (83 km/h; 52 mph). Thryduulf (talk) 23:09, 9 April 2010 (UTC)
Also, when you want to specify two output units, separate them with a space and not a vertical bar pipe symbol. For these units, your first two work, with the output in either order:
  • {{convert|45|kn|mph km/h|abbr=on|lk=in}} → 45 kn (52 mph; 83 km/h)
  • {{convert|45|kn|km/h mph|abbr=on|lk=in}} → 45 kn (83 km/h; 52 mph)
No kph, please. It's bad enough that we accept mph. Gene Nygaard (talk) 02:05, 10 April 2010 (UTC)

You've got pipes where you should have spaces, as noted above.

{{convert|45|kn|mph km/h|abbr=on|lk=in}}
{{convert|45|kn|km/h mph|abbr=on|lk=in}}
{{convert|45|kn|mph km/h|abbr=on|lk=in}}
{{convert|45|kn|km/h mph|abbr=on|lk=in}}
  • 45 kn (52 mph; 83 km/h)
  • 45 kn (83 km/h; 52 mph)
  • 45 kn (52 mph; 83 km/h)
  • 45 kn (83 km/h; 52 mph)

Note that kph doesn't work. JIMp talk·cont 06:21, 21 April 2010 (UTC)

Miles

A mile comes out in the text as mi. I am not aware of this usage in the real world; we always use mile or miles. It's not a word long enough to warrant abbreviation. (Sometimes one sees ml but that is out obviously.)

Could we get that changed?

Howard Alexander (talk) 18:39, 20 April 2010 (UTC)

I'm not sure I get the problem, {{convert|25|mi}} displays as 25 miles (40 km). Plastikspork ―Œ(talk) 01:14, 21 April 2010 (UTC)

I think he is saying that he has never seen mi as an abbreviation for mile. According to the mile article, this is the official abbreviation in the US. Alternatives such as m, ml, mil and M obviously conflict with the metric system. I think most people can figure it out when they see something like 'it is 100 km (62 mi) between the two cities'.  Stepho  (talk) 01:55, 21 April 2010 (UTC)

  • It was a good idea, but use "abbr=in" because the WP:MOS is unlikely to be changed to use that good idea. The use of "mi" is likely to confuse many non-US readers because that unit symbol is the WP:MOS default display for miles, when the input number is in kilometres, typically in a metric article, where km would be the common distance, while "mi" is the non-metric U.S. unit. Last year, I recommended the abbreviation style be reversed: instead, display the full word "miles" (or "mile"), while the input would be the "abbreviated" unit symbol km (for "kilometres"). The problem stems from the official WP:MOS style for displaying a conversion:
  • {{convert|46|km}}            gives:   46 kilometres (29 mi)
  • {{convert|46|km|abbr=in}} gives:   46 km (29 miles) ←abbreviate input unit not output
The display is similar for "lb" which some readers might question, so instead, I would have set the style to, again, abbreviate the input unit, not the output unit "pounds":
  • {{convert|14|kg}}             gives:   14 kilograms (31 lb)
  • {{convert|14|kg|abbr=in}} gives:   14 kg (31 pounds) ←abbreviate input not output
To change the official default style would require a consensus change to the WP:MOS, and many people have typically resisted change on Wikipedia. Plus, because WP:Featured articles are often welded onto the MOS-style, any change to the MOS would snowball into changing all featured articles. Meanwhile, just add option "abbr=in" on the first conversion of km-to-miles in an article, so that non-US readers would see the word "miles" there. -Wikid77 (talk) 11:56, 21 April 2010 (UTC)
Aha, so it's the default to put the abbreviation in and I have to add "abbr=in", which I was not aware of.
(I have no objection of course to which code is used in the convert template; just the way it appears on screen.)
I had not been aware that mi is a known abbreviation in the United States. The rest of the English Speaking World is another matter! That being the case (and given that all alternatives are out of the question as they clash with metric) I would seriously prefer the default to be the full word in this case. It is not a long word.
For other units, such as pounds, then the abbreviation lb is universal and usual so the abbrev should be the default.
Howard Alexander (talk) 12:44, 21 April 2010 (UTC)

Notice the "top speed" column, listing 330km/h==210mph, 340km/h==210mph, and 337km/h==209mph.

km/h mph (actual) Template:Convert Precision = 6 Precision = 0
330 205.052493 330 km/h (210 mph) 330 km/h (205.052493 mph) 330 km/h (205 mph)
337 209.402092 337 km/h (209 mph) 337 km/h (209.402092 mph) 337 km/h (209 mph)
340 211.266205 340 km/h (210 mph) 340 km/h (211.266205 mph) 340 km/h (211 mph)
342 212.508948 342 km/h (213 mph) 342 km/h (212.508948 mph) 342 km/h (213 mph)

68.187.217.100 (talk) 00:54, 19 March 2010 (UTC)

You can override the default precision. I have appended your table to give you such an example. Plastikspork ―Œ(talk) 01:25, 19 March 2010 (UTC)
The problem is that the template looks at the trailing zeroes in your input and tries to round the output to the same number of zeroes. So 330 gets rounded up to the nearest 10 while 337 gets rounded to the nearest unit. 6 decimal places is a bit overkill but rounding to 0 (ie no fractional part) works fine. I've extended the table too.  Stepho  (talk) 03:56, 19 March 2010 (UTC)
  • I guess we should compare increasing the precision by 1 digit, such as for 300 versus 30,000. -Wikid77 09:04, 19 March 2010 (UTC)
This is a problem that needs to be dealt with by the editors using the template. Convert will never be able to figure out whether the trailing zeros in front of the decimal point should be treated as significant. The editors need to fix it by specifying either the unnamed decimal place precision parameter or sigfig=x. I have no idea what WIkid77 is talking about; what difference does 500 km/h (310 mph) and 50,000 km/h (31,000 mph) make with respect to default precision? The one thing different about those is that we arbitrary add an extra significant digit in the default when there is no more than one clearly significant digit—note that we get similar results for 5 km/h (3.1 mph) when we don't even have any trailing zeros before the decimal point. We still get one more significant digit than what is really warranted; editors should be aware of that for many rough measurements and adjust the rounding parameters appropriately. But that's a different issue from the one raised by 68.187.217.100. Gene Nygaard (talk) 15:33, 19 March 2010 (UTC)
No, this is a perennial misunderstanding which in my short life as a Wikpedian I have seen here many a time, and have probably been guilty of it myself; if not here than in articles. If you don't specify a precision (dps or sig figs) then Convert *guesses*. When it guesses right, one doesn't notice, and when it guesses wrong, one complains it is wrong. It is not for editors to abnegate their responsibilities for sensible copy to a template.
Primarily, Convert is there to ensure consistent conversions of measure: people do not have to worry if an inch is 25.4mm or as an old dictionary of mine has it 25.3999mm for normal purposes. They are trying to express to a worldwide audience how big something is. That does not abnegate their responsibility for writing "ten inches" and wonder why it doesn't say "a quarter meter", or whatever.
It is simply exploratory programming; try it, see if it works to the precision you require, edit, debug, etc (preferably on a preview or in a sandbox). But I don't need to do that because I am a software engineer so all my stuff works right the first time, by definition. It's the computer that's wrong.
Si Trew (talk) 22:42, 9 April 2010 (UTC)
By the way the default tolerance on the software I work on is a floating-point number out by one part in 1010. So I am quite used to having to then finding something a little outside of tolerance and deciding if that is reasonable or indicating a real bug, one that might propagate etc. This takes a lot of work and skill and hunches. In the end, the convert template either works or doesn't -- nothing in the MOS says you have to use it (and I don't think the WP:MOSNUM uses it itself, beyond literally mentioning it: it shouldn't use it for examples, because it becomes self-referential), making Convert the god of correct conversions instead of its servant. Si Trew (talk) 22:48, 9 April 2010 (UTC)
This is a serious bug, meriting a fix or a prominent warning in the documentation. Converting 330 km/h to 210 mph, when 205 mph is correct is laughable.--Elvey (talk) 18:33, 28 April 2010 (UTC)