Category talk:Conversion templates

From Wikipedia, the free encyclopedia

[edit] Naming convention

I suggest using CamelCase names for the sake of readability as most of these are intended to be used within #expr (see m:ParserFunctions). The main reason I suggest CamelCase is that it keeps function names from breaking across lines (no spaces; yes you can use underscores but that gets ugly fast). If/when this grows large enough, it would probably be wise to protect these fully and create a single reference doc for this API (probably as part of a new WikiProject; maybe Wikipedia:WikiProject Template Functions?). See also Template:IsLeapYear (edit|talk|history|links|watch|logs) (which also uses CamelCase). —Locke Cole • tc 01:52, 15 April 2006 (UTC)

[edit] one way conversion

I think it's unnecissary to have conversion-templates two-way, I think that it only need to be conversion to SI-units, not from. For example you might need to convert from mile, but whan do you need to convert to? AzaToth 15:40, 15 April 2006 (UTC)

Suppose a user in England is writing the article. Their references are going to list things in kilometers, but they might think to provide the value in miles for readers who still use imperial units. --CBDunkerson 20:35, 15 April 2006 (UTC)
<joke mode on> Oops, I'm going to write a policy right now.... P: Avoid using miles (What about WP:AUM? Oh noes! already taken). Sorry for me being childish... --Ligulem 21:12, 15 April 2006 (UTC)
=) —Locke Cole • tc 21:55, 15 April 2006 (UTC)
Yup, that's why I thought they might be needed. =) —Locke Cole • tc 21:55, 15 April 2006 (UTC)
I belive that imperial units should only be used if the source data was using those, and no exact SI-eqvivalent is found. AzaToth 22:21, 15 April 2006 (UTC)
Speaking as someone living in a country using Imperial units everywhere, I respectfully disagree. Using conversion templates we can have both formats in an article with no excuse for excluding one or the other (if you only have the imperial unit value available, use a conversion template to convert to the metric system; and vice versa). Then readers from nations which don't utilize one system or the other can still read/understand the article without whipping out a calculator (this also saves editors from performing conversions improperly). —Locke Cole • tc 06:04, 20 April 2006 (UTC)
I agree, but do think that SI units should generally be listed first with the imperial in parentheses -> e.g. '10 m (32.81 ft)'. The SI are more 'internationally common' and used to some degree even in countries which haven't fully converted. --CBDunkerson 10:24, 20 April 2006 (UTC)
I'd rather avoid measurement system holy wars, but if you feel like tackling it, be my guest. =) FWIW, I agree with you that SI first and Imperial in parens makes sense, but I suspect a debate on which goes first may get ugly (ala Wikipedia:Eras). —Locke Cole • tc 10:38, 20 April 2006 (UTC)
It certainly might. There are a lot of us who insist that as a general rule, the original measurement should go first, followed by any conversions. That means, of course, that even within one article, some measurements might be English units first, some Fred Flintstone non-SI metric units such as calories or Pferdestärke (PS) first, and some SI units first (and a few articles even have original measurements in other units neither English nor metric, such as the shaku). Of course, there are many cases when either could be considered original, and there are various levels of being original (what was used as a source by a particular editor adding the information, vs. the units in which the original measurement was made, etc.) but those are different issues. Gene Nygaard 14:38, 22 April 2006 (UTC)

[edit] Significant Digits

Is there a policy regarding the use of significant digits within these templates? I was reading the article, California_Southern_Railroad#Cajon_Pass, and saw the following nonsensical text:

...until reaching the summit 6 mi (9.656 km) further...

Now, I know that 1.000 miles equals 1.609 kilometers, and therefore 6.000 miles equals 9.656 kilometers, but "6 miles" is absolutely not the same as "6.000 miles" and therefore does not equal 9.656 kilometers. Implicit in the expression "6 miles" is the notion of "± 0.5 miles", therefore the number of kilometers represented by "6 miles" could be in the range of:

  • 5.5 miles = 8.9 kilometers
  • 6.0 miles = 9.7 kilometers
  • 6.5 miles = 10.5 kilometers

...so the number of kilometers is something like 9.7 ± 0.8 kilometers. Given the wide implied error in the miles measurement, going down to the precision of a single meter in the kilometer measurement is just silly.

It seems to me that the most correct conversion would be 10 kilometers, although the given the low value of units involved and the difference in the implied error based on the different scale of the units, this would run the risk of overstating the distance because "10 kilometers" implies "between 9.5 and 10.5 kilometers" which only represents the high end of the range shown in the list above.

I must have too much time on my hands, but this bugs me. Can anyone suggest a solution? Mmccalpin 16:18, 12 July 2006 (UTC)

I'd suggest trying to get a more precise initial measurement, saying 'approximately 6 miles (9.656 km)', or leaving it as just '6 miles' with no conversion. As you note, trying to maintain significant digits in the converted value requires an assumption about how the original was rounded. I like the 'approximately' method because it makes clear that an exact measurement is not intended and then translates '6 miles' for those more familiar with SI units. --CBD 01:15, 13 July 2006 (UTC)