Template talk:Convert/Archive April 2011

Latest comment: 13 years ago by Frietjes in topic Sort error


lb/h & BTU/h

For Horsepower#Boiler horsepower: 30 lb/h (14 kg/h), 33,485 BTU/h ([convert: unit mismatch]) Peter Horn User talk 00:57, 22 March 2011 (UTC)

  • Already, the unit-codes "BTU" & "BTU/h" give the following:
          {{convert|1.0000000|BTU|abbr=on}} → 1.0000000 BTU (1.0550559 kJ)
          {{convert|1000.0000|BTU|kWh|abbr=on}} → 1,000.0000 BTU (0.2930711 kWh)
          {{convert|1000.0000|BTU/h|kW|abbr=on}} → 1,000.0000 BTU/h (0.2930711 kW).
    So, is the unit-code "kW/h" meant as kilowatt-hour (kWh)? Meanwhile, I changed unit-code "kWh" to reject invalid BTU/h and suggest "BTU" instead:
          {{convert|1.000|kWh|BTU/h|abbr=on}} → 1.000 kWh ([convert: unit mismatch])
I will work on unit-code "lb/h" with "Template:Convert/kg/h" but I am unsure what to do with kW/h. -Wikid77 22:01, 22 March 2011 (UTC)
In Horsepower#Boiler horsepower (this edit) they are trying to convert a power in BTU/h to "kW/h". This makes no sense and ought to be BTU/h to kW. It seems unlikely that "kW/h" would ever be used in practice. -- Dr Greg  talk  22:36, 22 March 2011 (UTC)
There's no such unit as "kW/h"! A (kilo)watt is itsef a rate of energy (=power) - 1 kilowatt equals 1 kilojoule per second - therefore "kW/h" would 'mean' kilojoule per second per hour.
A common unit for electricity (and gas these days) is the kilowatt-hour (kWh), equal to a kilowatt for an hour. ie, 3,600 kJ total, or 3,412 btu.
nagualdesign (talk) 22:09, 23 March 2011 (UTC)
Also "lb/h" is nonsensical. You may of course be paid in pounds per hour, but "weight per unit of time" means nothing. It's like saying "cats per dog"! :D (..well, not really) Regards, nagualdesign (talk) 22:32, 23 March 2011 (UTC)
An example of lb/h would be a conveyor belt (say, carrying coal, sand, gravel, ...) that can shift so many pounds (or kg) per hour over a specified distance.  Stepho  (talk) 23:47, 23 March 2011 (UTC)
I was only proposing that which I found in the article. If the article shows nonsense then let us correct the article accordingly. Peter Horn User talk 01:40, 24 March 2011 (UTC)
...evaporation of 30 lb/h: {{convert}} 30 lb/h (14 kg/h) or {{convert}}/h 30 lb (13.6 kg)/h of water. A cerain weight of water, or steam, evaporates over the period of one hour. It could also be the evaporation of a volume over the period of one hout. This merits a convert. Peter Horn User talk 02:23, 1 April 2011 (UTC)

Planning Convert/spell

As an initial step to spelling the first amount in a conversion, I have created Template:Spellnum to "say" a numeric amount in words. The current limit is 19,999,999.12345. For example:

  • {{spellnum|39}}                 → thirty-nine
  • {{spellnum|39|case=u}}     → Thirty-nine
  • {{spellnum|4265.0}}           → four thousand two hundred and sixty-five point zero
  • {{spellnum|19090999.33445}} → nineteen million ninety thousand nine hundred and ninety-nine point three three four four five

Per WP:MOS, spelled-out numbers should be kept simple, but the template does not restrict the number, in order to allow a user to get a decimal amount in words, in rare exceptions when needed. The new Convert/spell will be another, separate wrapper template, so the size and efficiency of Template:Convert will not be affected. Because most conversions are 3-digit integers ("145 kilometres"), I think the plan will work okay. -Wikid77 20:38, 2 April 2011 (UTC)

That's very cool :D It might be an idea to try and include commas and conjunctions: "nineteen million, three hundred and twenty-two thousand, four hundred and twelve", etc; shouldn't be horrifically difficult to implement. But I can see this being very useful in various places. Happymelon 22:59, 2 April 2011 (UTC)
Oh so loverly...Awesome and lomg overdue. Peter Horn User talk 00:34, 3 April 2011 (UTC)

Some additional conversions

For Mobile incinerator#The impact of waste composition on emissions:

Peter Horn User talk 18:49, 2 April 2011 (UTC)

Let's see: {{convert|67|BTU/lb}} → 67 British thermal units per pound (160 kJ/kg) and also {{convert|3|kJ}} → 3 kilojoules (720 cal), So, the plan is for "BTU/lb" and "kJ/kg" to be allowed. -Wikid77 20:38, 2 April 2011 (UTC)
Thanks. Peter Horn User talk 17:44, 3 April 2011 (UTC)

mi2?

When converting square miles to square kilometers (or any other area unit) and using abbr=on, is there a way to make the template display mi2 instead of sq mi? (e.g. 100 mi2 (259 km2) vs. 100 sq mi (259 km2)) LittleMountain5 23:51, 11 April 2011 (UTC)

It was decided long ago to use the more common/traditional abbreviations for customary/imperial measurements, i.e. sq mi for square miles, sq ft for square foot and [for lack of a better term] scientific symbols (abbreviations) for SI units, i.e. km2 for square kilometres, m2 for square metres. This also reflected the guidance of the Manual of Style. I think that the contrast between the customary abbreviations and SI symbols and never writing them as mi2 or sq km was desired and agreed upon. —MJCdetroit (yak) 01:48, 12 April 2011 (UTC)

Hi, I'm trying to learn to use this very handy gadget for converting horse heights. {{convert|115|–|135|cm|hand|1|abbr=in}} gives me 115–135 cm (11.1–13.1 hands), just as I would wish; but trying to wikilink hands by adding in |lk=out as in {{convert|115|–|135|cm|hand|lk=out|1|abbr=in}} gives me this: 115–135 cm (11.1–13.1 hands). Is it broken, or is it just that my syntax is wrong?

There's another little problem, too: the figure after the point in hand measurement is not decimal but base 4, i.e., it goes 14.0, 14.1, 14.2, 14.3, 15.0. But it looks like the converter is outputting decimal, such as 115–138 cm (11.1–13.2 hands). Is that fixable? Easily?
Justlettersandnumbers (talk) 22:30, 12 April 2011 (UTC)

It was neither broken nor bad syntax, the subtemplate had yet to be made. I've been wondering about this hands-dot-inches thing for a while. Don't you think using a dot this way might be confusing? For those unfamiliar with the convention it might seem that "14.2" means 14+210 not 14+24. Perhaps we're better off spelling it out in full as "14 hands 2 inches" but this is getting into WT:MOSNUM territory. JIMp talk·cont 00:06, 13 April 2011 (UTC)
WOW! That was quick, thank you very much. Heads-up: it's linked to a redirect; the article is at Hand (unit) now. Valid point on possible confusion; but that's the way it's written, and now that you've made the link work, anyone unfamiliar with the unit can read the article. It would be just great if you could fix the other bit too. Someone made a custom hands template, but it only works the other way, hands to cm and in. Many thanks indeed, Justlettersandnumbers (talk) 00:34, 13 April 2011 (UTC)
Perhaps 14-2 would be a valid compromise - those unfamiliar would not mistake it for a decimal point while those familiar with it would make the necessary leap.  Stepho  (talk) 00:38, 13 April 2011 (UTC)


{{edit protected|:template:convert/hand}} To fix the link we need an admin. Here's the new code for {{convert/hand}}.

{{convert/{{#ifeq:{{{4}}}|in|and/in_hand|{{{d}}}}}|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|s={{{s|}}}|r={{{r}}}|d={{{d}}}
|u=h
|n=hand
|l=hands
|t=Hand (unit)
|o=m
|b=0.1016
|j=-0.993106292-{{{j|0}}}}}<noinclude>
[[Category:Subtemplates of Template Convert]]
</noinclude>

How about "14 h 2 in" for an abbreviation? This matches the way the template abbreviates it when it's an input: {{convert|14|hand|2|in|abbr=on}} → "14 h (56.00 in; 142.24 cm)*". JIMp talk·cont 01:59, 13 April 2011 (UTC)

Okay, I updated {{convert/hand}} with the code provided above. Let me know if there are more updates. Plastikspork ―Œ(talk) 02:47, 14 April 2011 (UTC)

How's this? {{convert|150|cm|handin}} → "150 centimetres (14 h 3 in)" JIMp talk·cont 04:33, 14 April 2011 (UTC)

Thanks to all for help and suggestions, greatly appreciated. Having the possibility to output the "14 h 2 in" format would be a cool extra, but honestly I believe that "14.2 h" is pretty much universal. It's much more useful to be able to input in that "14.2 h" format. But more important at this moment is that despite all your work, it doesn't yet seem to be fully working:
  • {{convert|138|cm|hand|1|abbr=in|lk=out}} gives me 138 cm (13.6 hands), so appears to be still decimal; I think it should give 13.2 h
  • {{convert|13.2|hand|cm|1|abbr=out|lk=in}} gives me 13.2 hands (134.1 cm), but should I believe give about 137.2 cm
Am I doing something wrong?
Justlettersandnumbers (talk) 08:53, 14 April 2011 (UTC)
  • The format as "13.2 hands" will take some time to adjust for calculating as "13 & 2/4" but I realize that is the common notation. Meanwhile, use "{{convert|13|hand|2|in|cm|1}}" to give: 13 hands (52.00 inches; 132.08 cm)*. -Wikid77 12:03, 14 April 2011 (UTC)
  • Okay, the proposed update is in Template:Convert/hand/sandbox, where 13.2 will be considered as 13 hands 2 inches (rather than 13 & 2/10 of 4 inches):
  • {{convert|13.2|hand|cm}}  → 13.2 hands (137 cm)
  • {{convert|13.2|hand/sandbox|cm}} → 13.2 hand/sandbox[convert: unknown unit]
  • {{convert|14.3|hand|cm}}  → 14.3 hands (150 cm)
  • {{convert|14.3|hand/sandbox|cm}} → 14.3 hand/sandbox[convert: unknown unit]
  • {{convert|145|cm|hand|1 |lk=out}}  → 145 centimetres (14.1 hands)
  • {{convert|145|cm|hand/sandbox|1 |lk=out}} → 145 centimetres ([convert: unknown unit])
The coding was extremely complex to shift 0.1, 0.2 & 0.3 to be considered as inches (as fourths rather than 10ths), so that's why it took hours longer. The template has a source reference to show ".1" means 1 inch. Now, 145 cm, as 57 inches, will be 14.1 hands (14*4+1 inches). Some wikilink options "lk=on" will not work, yet, due to the special calculations overriding the formatting of ".1" as being 1/4 rather than 1/10. -Wikid77 16:43, 14 April 2011 (UTC)
Many thanks for all the work, had no idea it would be so complicated. It seems to work just fine for single quantities, but a value range (unfortunately quite often needed) such as {{convert|115|–|135|cm|hand/sandbox|1|abbr=in|lk=out}} is giving me a template loop error. Is that too fixable? Justlettersandnumbers (talk) 23:24, 14 April 2011 (UTC)
  • DONE. I have rewritten Convert/hand to use 4 sections of special calculations to transform the numbers into "hands.inches" notation. Ranges are displaying correctly now:
      • {{convert|115|–|135|cm|hand|1|abbr=in|lk=out}} → 115–135 cm (11.1–13.1 hands)
      • {{convert|14.1|or|14.3|hand|in|0|lk=on}} → 14.1 or 14.3 hands (57 or 59 inches)
    This is the first time we have used numbers which are not decimal format (where ".1" means 1/4 not 1/10), so that is why the calculations were so tedious. Previously, we mostly had the simple conversions of nuclear physics or rocket science, rather than complex conversions as in equestrian activities using discrete mathematics. Thank you for reporting the problem of the "hands.inches" notation, which had been overlooked for years ("Withers" had the wrong calculation since October 2009, for 19 months). This was an extremely difficult problem to fix, and there still might be some other related problems. -Wikid77 19:34, 15 April 2011 (UTC)
Another big round of thanks to all who have contributed to fixing this. I"m pleased to say that it appears to be working just fine now, and that is most satisfactory. Thank you, Justlettersandnumbers (talk) 20:34, 15 April 2011 (UTC)
OK, it's working nicely most of the time, but unfortunately not yet quite perfectly: {{convert|150|–|162|cm|hand|1|abbr=in|lk=out}} gives me 150–162 cm (14.3–16.0 hands), "150–162 cm (14.3–15.4 hands)". 15.4 is an invalid value in this context, so perhaps a little fine tuning is still needed? Thanks again, Justlettersandnumbers (talk) 23:25, 15 April 2011 (UTC)
  • ROUNDING FIXED. That fix required more time, due to customizing the rounding of amounts. So, single amounts will round correctly:
  • {{convert|162|cm|hand|2|abbr=in|lk=out}} → 162 cm (16.0 hands)
  • {{convert|162|cm|hand|1|abbr=in|lk=out}} → 162 cm (16.0 hands)
Plus, ranges also round 0.35 to +1 (rather than to ".4"):
  • {{convert|150|–|162|cm|hand|1|abbr=on|lk=in}} → 150–162 cm (14.3–16.0 h)
  • {{convert|142|–|162|cm|hand|disp=x| [|]|1}} → 142–162 centimetres [14.0–16.0 hands]
Ranges required more time to fix due to the rounding being encoded inside parameter {4}. I also enabled 72 of the major format options (such as "lk=on") for ranges of hands. -Wikid77 14:58, revised 19:03, 16 April 2011 (UTC)
ExcelLENT! Thank you for all the time and effort that's gone in to this. Justlettersandnumbers (talk) 00:23, 17 April 2011 (UTC)

How to convert km/h/s to mph/s

For 0 Series Shinkansen 1.0 kilometre per hour per second (0.62 mph/s) or perhaps 1.0 kilometre per hour per second (0.62 mph/s). If these notions are pure nonsense,then there are about a dozen or so infoboxes that need to be corrected. 1 m/s2 (3.3 ft/s2) works just fine. Peter Horn User talk 20:41, 13 April 2011 (UTC)

Google converts it as 1.0 km/(h⋅s) (0.28 m/s2), and we now have 1.0 km/(h⋅s) (0.91 ft/s2). Do you have an example of this unit in print in non-metric units (i.e., not ft/s2, but mph/s or mi/h/s)? Frietjes (talk) 21:15, 13 April 2011 (UTC)
No, I don't have such a sample, I am "shopping" for such a conversion for 0 Series Shinkansen, 100 Series Shinkansen etc. etc. I guess 1.0 km/(h⋅s) (0.91 ft/s2) will do. Using the template, 0.28 m/s2 (0.92 ft/s2) works. Peter Horn User talk 18:57, 14 April 2011 (UTC)
FWIW, I can only recall seeing km/h/s (2.77 m/s2 = 3.6-1 m/s2) used in one other place, which s a configuration file for the Japanese-origin BVE Trainsim railway simulator (and thus the need to parse the configuration file value in Openbve for compatibility). —Sladen (talk) 00:35, 14 April 2011 (UTC)
That would be 2.77 m/s2 (9.09 ft/s2) using the template. Peter Horn User talk 18:57, 14 April 2011 (UTC)

Three way mpg, miles per imperial gallon, L/100 km

30 mpg[convert: ambiguous unit] or 36 miles per imperial gallon (7.8 L/100 km). But what about a three way 30 mpg[convert: ambiguous unit] etc? Peter Horn User talk 18:28, 3 April 2011 (UTC)

By the way 30 mpg[convert: ambiguous unit], why is the .imp shown lower? 30 mpg[convert: ambiguous unit]. Peter Horn User talk 18:37, 3 April 2011 (UTC) Peter Horn User talk 18:39, 3 April 2011 (UTC)
I don't know why the "Imp" is shown as a subscript. Some sources report the symbol as "IG" or capitalize "Imperial gallon", so I have added unit-code "IG" to display the capitalized form, with the same numeric precision as unit-code "impgal". -Wikid77 07:20, 4 April 2011 (UTC)
I believe the capitalisation of "imperial" is an error. It's not a proper noun (sure "the British Empire" is but not "imperial"). We should, by all means accomodate ligitimate variation in English but not errors. Some sources might use "IG" but should we follow suit? The abbreviation "imp gal" is clear enough, "IG" is not, do we need both? JIMp talk·cont 00:13, 13 April 2011 (UTC)
If my memory serves me correctly, we literally made up those abbreviations to show the distinction between miles per imperial and U.S. gallons. In Canada and the U.K., they use "mpg" for miles per imperial gallon and here in the U.S., we use "mpg" for miles per U.S. gallon. We know it's a U.S. gallon and the Canadians and Brits understand that it is an imperial gallon being used in their countries' automotive commercials, but from a wikipedia perspective it needs to be clear and understandable to all. Hence, the way we've been doing it. For reference, here is the 61 mgp Fusion in Canada and the 41 mpg Fusion in the U.S.MJCdetroit (yak) 00:56, 13 April 2011 (UTC)

I agree that 'IG' is much less clear than 'imp gal' and we don't need both. A similar problem exists with the units of volume and we've solved it as follows:

  • code USgal -> output 'US gal', 'US gallons'
  • code impgal -> output 'imp gal', 'imperial gallons'

The 'mpg' version is not only inconsistent with that, but it's extremely hard to type without a template. How about we resolve the inconsistency and make it simpler to type. Thus:

  • code USmpg -> output 'US mpg', 'miles per US gallon'
  • code impmpg -> output 'imp mpg', 'miles per imperial gallon'

Regards Lightmouse (talk) 15:21, 17 April 2011 (UTC)

Usage questions

Help. Why can't I get the closing parenthesis (bracket) to show with this conversion: "1,000,000 square feet (about 93,000 m2)" using this syntax: {{convert|1000000|sqft|m2|disp=x| (about |)}}. I've got it in use at Shirlington, Arlington, Virginia: History in the third paragraph.

I fixed this one. Plastikspork ―Œ(talk) 23:50, 16 April 2011 (UTC)
Thanks. —  AjaxSmack  14:29, 17 April 2011 (UTC)

I would also like to use the |disp=5 and the {{convert/spell but these don't all work well together. Notice that {{convert/spell|1000000|sqft|m2}} gives "one million square feet (93,000 m2)" with "million thousand".

The final result I'd like is "one million square feet (about 95,000 m2)..." Thanks. —  AjaxSmack  22:28, 16 April 2011 (UTC)

abbr=values does not work here

36 (35; 40)* or 36 (35; 40) vs 36 t (35 long tons; 40 short tons)* or 36 t (35 long tons; 40 short tons) Peter Horn User talk 23:52, 16 April 2011 (UTC)

A whopping 1 inch off!

China Railways CRH1 500–1,200 mm (1 ft 8 in – 3 ft 11 in) as compared to 500–1,200 mm (1 ft 7.7 in – 3 ft 11.2 in). That is a whopping 1.2 inch difference!!!! What gives here? Peter Horn User talk 16:36, 18 April 2011 (UTC)

Also, compare to 500 mm (1 ft 8 in) and 1,200 mm (3 ft 11 in), so it is a problem with the range? Frietjes (talk) 16:53, 18 April 2011 (UTC)
  • I think the range is using the precision of the 1st number to format both amounts ("10 in" is 11.2 inches rounded to nearest 10); so when reversed, as first number 1200:
• {{Convert|1200|-|500.000|mm|ftin|abbr=on}} → 1,200–500.000 mm (3 ft 11.2441 in – 1 ft 7.6850 in)
• {{Convert|1200.00|-|500|mm|ftin|abbr=on}} → 1,200.00–500 mm (3 ft 11.244 in – 1 ft 7.685 in)
Note how 500.000 is only seen as 3-decimal precision due to "1,200.00" having extra zeroes. In general, beware the trailing zeroes and expect to append "|1" to round them. -Wikid77 12:49, 19 April 2011 (UTC)

Accommodate "or"

96 or 102 in (2,438 or 2,591 mm) instead of 96 in (2,438 mm) or 102 in (2,591 mm) Peter Horn User talk 21:50, 3 April 2011 (UTC)

Fixed by copying Template:Convert/to/AonSoff over Template:Convert/or/AonSoff, and changing the "to" to "or". Appears to be working now. Interesting that it was broken in the dozen or so transclusions I checked, so I am not sure why this wasn't noticed earlier. Thanks! Plastikspork ―Œ(talk) 22:24, 3 April 2011 (UTC)
Still a problem: Bombardier Zefiro 2.9 m (9 ft 6 in) or 3.4 m (11 ft 2 in) instead of 2.9 or 3.4 m (9 ft 6 in or 11 ft 2 in). Peter Horn User talk 01:11, 21 April 2011 (UTC)
  • Let's see: {{Convert|9.9|m|ftin|abbr=on}} → 9.9 m (32 ft 6 in), so that can be combined with
    another number, as {{Convert|9.9|or|3.4|m|ftin|abbr=on}} → 9.9 or 3.4 m (32 ft 6 in or 11 ft 2 in),
    using lk=on as {{Convert|9.9|or|3.4|m|ftin|abbr=on|lk=on}} → 9.9 or 3.4 m (32 ftin or 11 ft 2 in).
    The 2 sets of ft/in are shown by Template:Convert/or/AonSoffAnd. -Wikid77 09:03, 23 April 2011 (UTC)

Large numbers

I'm editing a lot of geology articles, and some of the numbers are huge. For example, one is 6 billion tonnes, so I could do {{convert|6000000000|t|ST}}, but that's a lot of zeros. I imagine it's also a violation of WP:MOS, but I'm not sure. What alternatives are there? Or is writing that many 0's perfectly acceptable? Thanks. OrangeMarlin Talk• Contributions 20:37, 27 April 2011 (UTC)

We do have some that support this, like 60 million square metres (650,000,000 sq ft) or 60×10^6 m2 (650,000,000 sq ft). Frietjes (talk) 20:48, 27 April 2011 (UTC)
Wow fast answer. Thanks. I'll give it a try. OrangeMarlin Talk• Contributions 20:50, 27 April 2011 (UTC)
It doesn't look like we have tonnes yet, but it would be easy to make one. Frietjes (talk) 20:53, 27 April 2011 (UTC)
Yup, I tried e6t....no go. How to I request one for future use? I've done several templates with these huge numbers. You cannot believe how large meteors are!  :) OrangeMarlin Talk• Contributions 20:54, 27 April 2011 (UTC)
I just made it. Try this {{convert|6|billion tonne|ST}} and report any bugs. Frietjes (talk) 20:59, 27 April 2011 (UTC)
  • Testing
6 billion tonnes (6.6×109 short tons) or 6 billion tonnes (6.6×109 short tons)
6 million tonnes (6,600,000 short tons) or 6 million tonnes (6,600,000 short tons)
6 thousand tonnes (6,600 short tons) or 6 thousand tonnes (6,600 short tons)
6 tonnes (6.6 short tons) or 6 tonnes (6.6 short tons)
And more, see above (including e9t, e6t, and e36 shortcuts) . Frietjes (talk) 21:05, 27 April 2011 (UTC)
Technically the e6 ones should use the Eng conversions, but I guess that could be updated if necessary, rather than just having them as redirects. Frietjes (talk) 21:12, 27 April 2011 (UTC)
OK, this has got to be the fastest group on Wikipedia. I just thought it would show up next week or something. I'm going to have me some fun! Thanks again. OrangeMarlin Talk• Contributions 21:18, 27 April 2011 (UTC)
One issue with the billion, million, thousand tonne.....the linking doesn't work. I have found that a lot of people don't know what a "tonne" is (or even ST or LT, but those links work). Can you fix that? I'm now officially abusing your gracious assistance. OrangeMarlin Talk• Contributions 21:22, 27 April 2011 (UTC)
billion tonnes (6.6×109 short tons) or 6 billion tonnes (6.6×109 short tons)
6 million tonnes (6,600,000 short tons) or 6 million tonnes (6,600,000 short tons)
6 thousand tonnes (6,600 short tons) or 6 thousand tonnes (6,600 short tons)
6 tonnes (6.6 short tons) or 6 tonnes (6.6 short tons)
Linking should work now. I also change the e3t, e6t, and e9t shortcuts to use the Eng conversions. There is a difference in how the linking works. We should probably just redirect the "billion tonne" one to "e9t" since the linking is better in that one. Frietjes (talk) 22:15, 27 April 2011 (UTC)
Wow. Thank you very much. I'm going to have to see how you did this. Probably will be way over my head, but I'm curious. OrangeMarlin Talk• Contributions 23:03, 27 April 2011 (UTC)

Some editors dislike conversion templates, part 2

Please see Some editors do not like conversion templates in the January 2011 archive.Peter Horn User talk 16:40, 17 March 2011 (UTC) Peter Horn User talk 16:42, 17 March 2011 (UTC)

  • I have renamed this topic as "...part 2" so we can continue discussion here (for a review of the earlier discussion from December 2010, read the archived topic, linked above). The goal still remains, to keep making Convert even faster. There was a recent scare, when people began talking of "replacing Convert" with a WP:parser function, but those fears have been reduced by explaining the vast scope provided by Convert in the English Wikipedia, and using both English and foreign unit names in some other-language wikipedias. Meanwhile, several people were concerned to always maintain the non-breaking amount+unit (such as "9&nbsp;km") and show the Unicode &minus, so those tedious changes were made before reducing the templates which perform the rounding. At this point, we can switch to using Template:Rndpad which only invokes complex scientific notation for numbers above 85 billion. Also, remember some people wanted to use highly complex conversions (rather than the opposite idea of removing Convert), so that led to {Convert/4} and {Convert/gaps}:
  • {{Convert/4 |2|x|6|x|7|up to|8|m}} → {{convert/4|2|x|6|x|7|up to|8|m}}
  • {{Convert/gaps |8650.12370|mi|km}} → {{Convert/gaps |8650.12370|mi|km}}
So, those more complex templates are proof that other people are wanting even more uses of Convert, rather than to stop using Convert. -Wikid77 21:29, 17 March 2011 (UTC)
Ah yes, I remember now, User:Ucucha was just one of those naysayers who reversed my edit (the use of{{convert}}) in Marsh rice rat. See User talk:Ucucha/Archive17#Marsh rice rat. By the use of the template I caught a converssion error in that article. In future I'm going to keep track of those naysayers, and post their userpages here. Peter Horn User talk 01:41, 18 March 2011 (UTC)
Well, many users forget why to use Convert in various cases, so I have created {{Convert/benefits}} as a reminder (see below). -Wikid77 13:59, 18 March 2011 (UTC)
It is not just that many users forget to use them, it is also that many users don't want them, User:Ucucha is one of those. Peter Horn User talk 17:06, 18 March 2011 (UTC)
In my archives I found the following two "gems", User talk:Peter Horn/Archive 2#Templates and User talk:Peter Horn/Archive 2#Wagonway. The former shows two users objecting to the use of convert templates. Peter Horn User talk 17:35, 18 March 2011 (UTC)
Yes, I prefer not to use the template (in fact, what I usually do is using a substituted version of user:ucucha/m). Of the benefits listed on the linked page, the first six don't differ from the way I handle conversions (though I admit that {{convert}} so far handles rounding a little better); the seventh is a marginal benefit (the same thing could be done by an intelligent script traversing a database dump); the eight I don't understand; and why the ninth is a benefit, I have no idea (it sounds more like a usage guide). On the other hand, having the raw numbers instead of a convert template in the wikitext enables me to check that the conversion is accurate in the editing screen, without having to look at the rendered version of the page. Ucucha 22:41, 22 March 2011 (UTC)
Very ingenious, but this line of argument demonstrates a lack of understanding of the infinite possibilities of these templates and an unwillingness to learn. Eg the rounding off is controlled by the user and nrrd not be left to chance. Examples: 3,000 miles (4,800 km), 3,000 miles (4,828 km), 3,000 miles (4,828.0 km), 3,000 miles (4,830 km), 3,000 miles (4,828 km), 3,000 miles (4,828.0 km). The spelling is also controllable by the user, e.g. 4,000 kilometres (2,500 mi) and 4,000 kilometers (2,500 mi) or 5,000 tonnes (4,900 long tons; 5,500 short tons) and 5,000 metric tons (4,900 long tons; 5,500 short tons). When converting from one unit to two other units your method becomes unworkable. Peter Horn User talk 02:30, 7 April 2011 (UTC)
I know about those options. However, my point remains that I generally need to look at the rendered output to make sure it is as I want it to be. If the conversion is just in the wikitext, that's not such a concern. And of course, there are many things my substitutable template doesn't support; that's not a problem, because I don't use those things. Ucucha 02:35, 7 April 2011 (UTC)
Canst thou share (show) thine "substitutable template"? I am curious to see what thou meanst by that. Peter Horn User talk 15:40, 7 April 2011 (UTC)
My guess is that User:Ucucha/m is the template (see above). Frietjes (talk) 16:26, 7 April 2011 (UTC)
Whatever the case may be, User:Ucucha/m's method was not able to prevent in Marsh rice rat the following: 0.23 ha (0.51 ha) to 0.37 ha (0.81 acre). The use of the {{Convert}} made that automatically 0.23–0.37 ha (0.57–0.91 acres). By the way, User:Ucucha/m turns out to be an "Invalid unit". The plot thickens Peter Horn User talk 17:05, 18 April 2011 (UTC)
Don't give the poor thing too much power; I created it after I wrote the marsh rice rat article. That User:Ucucha/m shows "invalid unit" is not surprising, since the template is only to be used when substituted. Ucucha 22:39, 18 April 2011 (UTC)
In an old revision of Blackpool tramway#Balloon cars I found the following "howler" (or "gem"): 57 hp (25 kW). The template gives 57 hp (43 kW). Peter Horn User talk 01:25, 27 April 2011 (UTC)
See Template talk:Convert/Archive March 2011#Template:Convert/benefits to list reasons for use. Peter Horn User talk 01:38, 27 April 2011 (UTC)
In Navenby#Climate I came upon this very wild guess (?), 3 ft (600 mm). One guess what I did to that one. But may be 2 ft (600 mm) was meant. 3 ft (914 mm) or 2 ft (610 mm), heads or tails (toss a coin) Peter Horn User talk 19:09, 29 April 2011 (UTC)

Sort error

Any idea why the 3.5 acre entry does not sort correctly in this table? Vegaswikian (talk) 06:26, 29 April 2011 (UTC)

The sort key being used by 3.5 is "00000000000003.5000000000", which has 13 leading zeros. However, the sort key being used by 5 is "0000000000000005000000000", which has 15 leading zeros. To correct the problem, we need to make sure they are both using the same amount of left zero padding. I will try to find the exact point of deviation. Frietjes (talk) 16:21, 29 April 2011 (UTC)
The issue is in the first part of the main template. Here is a table showing the issue.
3.5 00000000000003.5
5 0000000000000005
I think we want to have it align decimals, so remove the integer part for the first padding, and add the fraction part in a second padding. I could do some testing, but more input would be good here. Frietjes (talk) 16:29, 29 April 2011 (UTC)
A partial fix would be to make this change. I am almost certain this wouldn't make things worse, but it also wouldn't fix all the problems. There is a reason why Template:nts and Template:ntsh are somewhat complicated. Should we just call one of those? In particular, Template:ntsh just makes the hidden sort key. Also, can someone explain why we have the {{{3}}} at the end of the sort key? Is this for range conversions? Frietjes (talk) 16:51, 29 April 2011 (UTC)
You could always remove the convert templates and do {{Sort|Sortkey|Conversion}}.Jason Rees (talk) 22:58, 29 April 2011 (UTC)
I think the idea is to have the sortkey automatically generated, since specifying it twice can frequently lead to a mismatch when one is updated but not the other. We should be able to fix this by just calling {{ntsh}} for the sort key. Frietjes (talk) 23:43, 29 April 2011 (UTC)