Jump to content

Template talk:Convert/Archive May 2014

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


Template:Circle of latitude

Hi, I'm raising this here because the talk page of the template itself does not exist, and I see that there is some traffic here of people who may be able to help with it, as it is in the "Conversion templates" category.

In the articles Arctic Circle and Antarctic Circle, the template "Circle of latitude" is invoked to supply the figure for latitude, which is said in the articles to be as of 2012. However, there is no template documentation to indicate when the figure was last updated, and nothing to indicate that if one does change it then one should also change the "as of" date that is mentioned in articles that use it. In fact, it seems from the edit history that the figures have not been updated since 2010. The articles Tropic of Cancer and Tropic of Capricorn, which use the same template,* say that the date is as of 2014.

I think maybe in 4 years there could have been a small change to the least significant digit at the accuracy quoted, which is not a huge deal at the moment, but nevertheless the way this is currently organised is obviously very unsatisfactory for maintenance. Ideally, the "as of" date should be maintained once, in the template, and this should be automatically inserted into articles that use it. 86.169.185.1 (talk) 02:14, 8 May 2014 (UTC)

Double conversion, convert/spell

For Seboomook Lake and Saint John Railroad#History, {{convert/spell|8|to|10|cord|m3|lk=on}} instead of {{convert|8|to|10|cord|m3|lk=on}} eight to ten cords (29 to 36 m3) instead of 8 to 10 cords (29 to 36 m3). Peter Horn User talk 17:00, 9 May 2014 (UTC)

see the last time you asked. Frietjes (talk) 17:13, 9 May 2014 (UTC)
My grandson Jozua tells me that I have the memory of a gold fish. Peter Horn User talk 02:29, 13 May 2014 (UTC)

fraction slash

{Convert} now accepts the slash in fractions.

  • {{convert|3+1/2|m|in}} → 3+12 metres (140 in)

This is the keyboard slash U+002F / SOLIDUS (/). In typography, and in our {{frac}}, another character is used: 3+12. That is U+2044 FRACTION SLASH (⁄).

We could consider that if it is correct in typography, {convert} should accept it as correct number input.

  • {{convert|3+1⁄2|m|in}} → 3+12 metres (140 in) -- U+2044 used

I met this when I did a copy-paste with a frac number. There also exists U+2215 DIVISION SLASH, which I have not researched yet. I note that with fractions input, the ambivalent "3-1/2" input is still accepted: [convert: invalid number]. -DePiep (talk) 10:22, 13 April 2014 (UTC)

Sorry to be a wet blanket, but unpicking the code that parses input numbers, including fractions, still is unappealing. One problem is that there are several alternatives that might be useful once or twice—if supporting fraction slash, why not support ⁄ and ⁄ because they look the same when viewing wikitext? I would have thought that using fractions for input was fairly rare, and since an editor has to insert a + before the numerator, they may as well also use a plain slash. I agree that accepting 3-1/2 to mean 2+1/2 is a bad idea. I'll put that on my to-do list. Johnuniq (talk) 02:29, 14 April 2014 (UTC)
As one can read, no "problem" involved. I only want to introduce the point that when some text is an accepted number, {convert} should have to eat it as a number. This is a next design step, after the (great & good) design step to repleace {convert}-wikitext 1:1. So, now that we are free of wikitext, we can propose to redesign the module. -DePiep (talk) 00:57, 26 April 2014 (UTC)
  • Fractions are more rare than dash ranges: Indeed, fractions are extremely rare in conversions, when compared to dash-ranges, although ironically, in real-world text, the text-slashes are 3x times more common than dashes (as in "April/May"). Consequently, {convert} has needed to handle unicode en dash "–" in several pages. So rather than support &frasl input, the higher priority is for dash-ranges or wp:non-breaking hyphen (&8209), as follows:
Currently, when people request unusual formats, we suggest they hand-code the conversion with whatever slashes or other characters are needed in the output. -Wikid77 (talk) 05:29, 14 April 2014 (UTC)
No priority or tradeoff was claimed here. It is just that the (higher) aim should be to accept accepted numbers. -DePiep (talk) 17:18, 14 April 2014 (UTC)
  • For more accepted numbers, use {convert/old}: The prior, wikitext-based {{convert/old}} allows other forms of accepted numbers, such as "2+3" or "pi" metres. Compare:
  • {convert|2+3 |m |ft }} = [convert: invalid number], with 2+3
  • {convert/old |2+3|m|ft}} = , with 2+3
  • {convert|pi |m |ft }} = [convert: invalid number], with pi
  • {convert/old|pi|m|ft}} = , with pi
  • {convert/old|2*pi|m|ft}} = , with 2*pi
  • {convert|π|m |ft }} = [convert: invalid number], with π
  • {convert |2+1/2 |ft |3/4 |in}} = 2+12 feet 34 inch (0.781 m)
  • {convert/old|2+1/2|ft|3/4|in}} =
To allow a larger variety of fraction inputs, then create a {convert/frac} wp:wrapper template to transform other fraction symbols into {convert} syntax. -Wikid77 (talk) 11:55, 14 May 2014 (UTC)
{{convert|{{#expr:pi * 2}}|in|m}} → 6.2831853071796 inches (0.15959290680236 m)

-DePiep (talk) 12:09, 14 May 2014 (UTC)

Wrap behavior

What is the wrap behavior (default & options)? Especially between the basic two output units (their joint). Internally a measurement is nowrap, OK. Help page gives option |disp=br, which is clear. -DePiep (talk) 12:59, 15 May 2014 (UTC)

The details are ugly, but something should be documented. You are possibly only asking about Help:Convert#Joins, but other cases also need documentation, so I have added the "Separators" section below with nearly all the details, I think. The notes should be recast in terms of wrapping, and perhaps {{nowrap}} should be mentioned. I'll put some of this at Help:Convert later, but most of it should be in an "advanced" section for anyone wanting details because including all this in the standard documentation would make too much of an impenetrable mess. Johnuniq (talk) 06:52, 16 May 2014 (UTC)
Great, as always. I was expecting a yes/no answer ;-). I've shuffled your points, as a proposal (towards documentation). -DePiep (talk) 10:44, 16 May 2014 (UTC)

Wrapping and line breaking

Documentation text, now in Help:Convert#Wrapping_and_line_breaking

Wrapping is possible where a regular space (" ") is used. Nowrap is enforced by using nonbreaking space ( ), tying and keeping text elements together.

3 feet may break after "3"
3 ft will not break after "3"

In the examples below, a   is shown as "_" (a red underscore): "3_ft".

A line break (<br/>) overrules any nowrap setting at that point.

Within a measurement (value+unit)

The separator between the value and the unit can be a space or a nonbreaking space (&nbsp;):

  • When a unit is abbreviated (symbol is shown), the separator is &nbsp;.
{{convert|12|m|ft|abbr=on}} → 12_m (39_ft)
  • When a unit is not abbreviated (name is shown), the separator is a space.
{{convert|12|m|ft}} → 12 metres (39_ft)
This can be set (overruled) to be &nbsp; by |adj=j (for 'join').
{{convert|12|m|ft|adj=j}} → 12 metres (39_ft)*
  • Some units do not have a symbol and always use a space (such as acre).
{{convert|3|acre|m2|abbr=on}} → 3 acres (12,000_m2)
  • Except, option |adj=j ("join") forces the separator to be &nbsp;.
{{convert|3|acre|m2|adj=j}} → 3 acres (12,000_m2)*
  • Except, &nbsp; is always used when a measurement is in multiple units.
{{convert|1|ft|6|in|cm}} → 1_foot 6_inches (46_cm)
{{convert|2|m|ftin}} → 2 metres (6_ft 7_in)
  • Except, if option |adj=on is used and the unit is not abbreviated, the separator is a hyphen ("-").
{{convert|2|m|ftin|adj=on}} → 2-metre (6_ft 7_in)
  • When the name of a number is used, &nbsp; is used as the separator between the value and the name. For example, a measurement spelled as "12 million metres" has &nbsp; before "million" and a space afterwards.
{{convert|12|e6m}} → 12_million metres (39,000,000_ft)
Between measurements
  • A space is used as the separator in a join between the first and second measurement.
{{convert|3|ft|m}} → 3 feet (0.91_m)
  • Except for the special cases before "/" and before "[" :
{{convert|12|in|cm|disp=slash}} → 12 inches (30_cm)* (&nbsp; before "/")
{{convert|12|in|cm|disp=sqbr|abbr=on}} → 12_in_[30_cm] (&nbsp; before "[")
  • Multiple output measurements (by listing units) always use a space between measurements ("; " has a space after ";").
{{convert|2|acre|m2 sqft ha}} → 2 acres (8,100_m2; 87,000_sq_ft; 0.81_ha)
Between components of a measurement (e.g., in a range; between foot–inch)
  • A measurement in multiple units always uses a space between components ("1 foot 6 inches" has &nbsp; before the unit names, but a space after "foot").
{{convert|1|ft|6|in|cm}} → 1_foot 6_inches (46_cm)
  • In a range, spaces are generally used to separate items. For example, "to" and "or" have a space before and after in the following.
{{convert|12|to|20|in|cm}} → 12 to 20 inches (30 to 51_cm)
{{convert|12|or|20|in|cm}} → 12 or 20 inches (30 or 51_cm)
  • The ranges +/- and , and xx always use &nbsp;:
{{convert|12|+/-|2|in|cm}} → 12_±_2 inches (30.5_±_5.1_cm)
{{convert|12|,|20|in|cm}} → 12,_20 inches (30,_51_cm)
{{convert|12|xx|20|in|cm}} → 12_×_20 inches (30_×_51_cm)
  • The "to-" range (same as "to(-)") is an exception. When a unit is not abbreviated, "to" has &nbsp; before and a space after.
{{convert|12|to-|20|in|cm}} → 12 to-[convert: unknown unit]
  • The "x" range is an exception. When a unit is abbreviated, "×" has a space before and &nbsp; after.
{{convert|12|x|20|in|cm}} → 12 by 20 inches (30_cm ×_51_cm)
Overrule by setting a line break
  • Parameter |disp=br adds a forced line break (<br/>) between measurements; brackets are omitted.
{{convert|12|m|ft|disp=br}} → 12 metres
39 feet
Preview wikicode

To see the wikicode result of the convert template: put your {{convert|...}} code into Special:ExpandTemplates and then preview by clicking OK.

Johnuniq (talk) 06:52, 16 May 2014 (UTC)

Proposal by edit: use terms "measurement", "component" with consistent meaning, and group existing points. Added ;label subheaders. Add "nowrap" starting point. -DePiep (talk) 10:40, 16 May 2014 (UTC)
Same for section title: "Wrapping and line breaking". Use a singular meaning in documentation helps. -DePiep (talk) 10:47, 16 May 2014 (UTC)
We could write the examples like 2_metres_(6_ft_7_in). -DePiep (talk) 10:53, 16 May 2014 (UTC)
Started the join & linebreak entries. Could use a check for completeness. -DePiep (talk) 07:55, 17 May 2014 (UTC)
Formatting. A rule has the bullet, the examples indent. (prepare for help documentation) -DePiep (talk) 07:07, 19 May 2014 (UTC)
More formatting and ce, Introduced the _ form for nbsp. -DePiep (talk) 08:07, 19 May 2014 (UTC)
  • Johnuniq@ About the first three "Except, ..." rules above. As they show now, it is not clear for which rule they are an exception: only #3 "Some units do ..", or for #1, #2, #3 together?
I think this can be made unambiguously clear by reordering the bullets and/or indenting the exceptions. Or if you simply answer here, I can do the layout. (Of course I could deduct this by trials, but that would be a tough job). -DePiep (talk) 08:07, 19 May 2014 (UTC)

I've added this section to Help:Convert#Wrapping_and_line_breaking (new). Whenever an "advanced" help or documentation is developed, parts could move there. -DePiep (talk) 11:07, 25 May 2014 (UTC)

Thanks. Johnuniq (talk) 11:25, 25 May 2014 (UTC)

{{TonCwt to t|19|10|lk=on}}19 long tons 10 cwt (43,700 lb or 19.8 t) does not link to long ton as in does in {{convert|19|LT|lk=on}} 19 long tons (19 t). And cwt and t are not linked at all. Why? Peter Horn User talk 04:41, 7 May 2014 (UTC)

I don't know, but the documentation at {{TonCwt to t}} specifies that behavior, saying it is traditional for certain locomotives. That template is used on 266 articles so it's probably not a good idea to change what it does without a wide discussion on the relevant wikiproject talk. Johnuniq (talk) 05:38, 7 May 2014 (UTC).
Traditional, or not traditional, I fail to understand how a blanket link to avoirdupois is very helpfull, unless one is prepared to scroll through the article. Separate links to long ton and long hundredweight would perhaps he more useful7helpful. Peter Horn User talk 17:38, 7 May 2014 (UTC)
For Locomotive No. 1, {{TonCwtqtr to t|26|1|1}} {{TonCwtqtr to t|26|1|1}} Peter Horn User talk 04:23, 8 May 2014 (UTC)

I checked all usage of the template in articles as they were at 2 May 2014. The template is used 605 times in 251 articles. Almost all of them are like "{{TonCwt to t|12|3}}", and the only exceptions are:

If you think the template should do something different, I suggest you copy this comment (edit it however you like) to the relevant wikiproject. Make a proposal for how the lk=on examples should look, and allow at least two days for comments. If no objections, reply here with a link to the discussion and someone will probably help to change the template. Johnuniq (talk) 06:03, 8 May 2014 (UTC)

After going systematically through {{VRLocos}} I found a number of additional exceptions. The usage is consistently inconsistent. Peter Horn User talk 14:02, 8 May 2014 (UTC)
PS what is the link to the relevant project page? Peter Horn User talk 14:05, 8 May 2014 (UTC)
OK,I posted at Template talk:Convert/TonCwt to t#Just curious Peter Horn User talk 01:01, 9 May 2014 (UTC)
Any change to that template would affect the articles I listed above. Looking in the headers at the top of the talk page for each article shows the relevant wikiprojects. I would say that only WT:WikiProject Trains is active, and a proposal should go there. Show the current output from one of the above examples, and add the wikitext to show what you believe the result should be. Invite comments. If no objections in two days ask someone to change the template. Johnuniq (talk) 06:32, 9 May 2014 (UTC)
I put a post at Wikipedia talk:WikiProject Trains#A small problem referring back to Template talk:Convert/TonCwt to t#Just curious. Peter Horn User talk 12:28, 9 May 2014 (UTC)
And that is where there are additional posts/comments. Cwt is now linked,see above. Peter Horn User talk 14:03, 27 May 2014 (UTC)