Template talk:Convert/Archive August 2015

No editing the documentation sections
I see that section editing is possible for the /doc subpage, but why is is there no edit tags for the main page documentation? Why do I have to View /doc first, before I can edit the section I'm reading? &mdash; Cp i r al  Cpiral  06:07, 1 August 2015 (UTC)
 * What page are you looking at? What is an example section with a problem? What do you see or not see? Johnuniq (talk) 06:42, 1 August 2015 (UTC)
 * Template:Convert has no section editing at all. But Template:Convert/doc does, and it is accessible by View link on the first line of the doc box. There must be something wrong. &mdash; Cp i r al  Cpiral  16:16, 1 August 2015 (UTC)

does show the edit links in a sandbox once that sandbox is saved. And for example Val does show the edit links as it should. &mdash; Cp i r al  Cpiral  19:55, 1 August 2015 (UTC)
 * At Template:Convert I see "[edit]" just after the "Ranges of values" heading, and clicking the edit link shows the edit window for that section. Perhaps clear your browser cache? Johnuniq (talk) 23:19, 1 August 2015 (UTC)
 * Turns out when a template's edit tab says "View source" instead of "Edit", ya hafta read the /doc page directly if you want to edit sections of what you read. (I found out by logging out and looking at Val.)


 * If you just want to edit the entire /doc, you can do that from the main page by pressing "edit" in the doc box; otherwise to edit sections you have to press "view" in the doc box and read the /doc directly. So it's a bug. Grate! I've reported it on phabricator https://phabricator.wikimedia.org/T107685?workflow=create &mdash;  Cp i r al  Cpiral  04:53, 2 August 2015 (UTC)

New area unit: Feddan
I'm only very slightly proficient with template markup, and I'd appreciate someone adding the feddan (I edit Egypt articles from time to time).

The Egyptian standard feddan is 4200 square meters, or 0.42 hectares, or 1.038 acres. Sudan uses the same unit. Syria uses a smaller feddan, but it is less used as the dunam is also a common unit of land measurement there. I don't know which definition Oman uses. Lockesdonkey (talk) 21:58, 5 August 2015 (UTC)
 * @Lockesdonkey: I created the unit at Module:Convert/extra based on the modern definition apparently used in Egypt. That is a temporary work area for trying new units. If it is useful in an article, the definition can be moved into the main list of units. Units with no clear or universal definition are a problem for the convert template, and it might be better to just use words in an article to say what is wanted. The current definition works like this:
 * → 1 feddan
 * → 200 feddan
 * We can review the unit later because I am reluctant to add new units unless they are useful in articles. Johnuniq (talk) 10:17, 6 August 2015 (UTC)


 * I know already that it would be useful in at least one place: Economy of Egypt, as editing that page was what led me to come here. Other than that, there are a number of articles (at a minimum, a substantial proportion of the pages that link to the article feddan) which might be improved by such a template (particularly ones dealing with settlements and with Nasser's land reforms, of which there are several), and I have a plan, at some point when I have the time and can find a reliable source, to work on improving the infoboxes for various Egyptian settlements (as in towns/cities), and Egyptians usually quote the area of a settlement in feddans. Even if I won't be using it immediately for some of these purposes, I will be using it. Lockesdonkey (talk) 17:00, 6 August 2015 (UTC)
 * Good, there's no deadline! Johnuniq (talk) 23:25, 6 August 2015 (UTC)

Module version 12
Some changes to the convert modules are in the sandbox, and I intend switching the main modules to use the sandbox soon.

The changes are:
 * Units:
 * The new unit code au is like AU but displays "au" as the symbol (discussed here and more verbosely at MOSNUM):
 * → 1 au
 * → 1 AU
 * Some extra links have been added so automatic per units of these types will link to the articles shown, if  applies (discussed here):
 * energy/time → Power
 * force/area → Pressure
 * length/length → Gradient
 * length/time → Speed
 * Units G (gauss) and K (kelvin) accept SI prefixes, mainly for val. Unit MK (megakelvin) has been removed as redundant given that K accepts the M (mega) prefix.
 * The processing of ranges is now uniform—the rules for a range of two values also apply to ranges of three or more values. Some minor processing for compatibility with the old templates has been removed—I don't think that will affect any converts in articles.
 * The option  has a misleading name but it is used in a handful of articles and seems reasonable. If used, it causes the input unit name to be repeated for a range. An example is at Commodore Nutt:
 * → Nutt had grown from his original 29 to 43 in
 * The range  is now MOS-compliant in that it always repeats the unit symbol when displaying a multiply symbol (×). Previously, that only occurred for a range of two items. For compatibility with current usage (  is used over 6,000 times in articles), the range shows "×" when units are abbreviated and "by" when they are in full. Displaying "by" means convert defaults to using natural language such as "2 by 3 feet" for the input.
 * The new  range is for those who prefer showing more clearly that "by" is intended for the values first displayed. Examples:
 * Fixed bug in singular/plural unit name when rounding the input:
 * New  option to round the output to the nearest half, with the display being either N or N.5 where N is an integer (discussed here):
 * → }
 * A new function is exported and may be used by other modules to access convert's data (discussed here).
 * The html span output generated for  is now the same as that produced by ntsh. Module:Val uses the   function which can also produce a span element with a hidden sort key.
 * New  option to round the output to the nearest half, with the display being either N or N.5 where N is an integer (discussed here):
 * → }
 * A new function is exported and may be used by other modules to access convert's data (discussed here).
 * The html span output generated for  is now the same as that produced by ntsh. Module:Val uses the   function which can also produce a span element with a hidden sort key.
 * The html span output generated for  is now the same as that produced by ntsh. Module:Val uses the   function which can also produce a span element with a hidden sort key.

Module version history 1 (Dec 2013) • 2 (Jan 2014) • 3 (April 2014) • 4 (July 2014) • 5 (Sep 2014) • 6 (Nov 2014) • 7 (Dec 2014) • 8 (Feb 2015) • 9 (Feb 2015) • 10 (May 2015) • 11 (June 2015)

Johnuniq (talk) 09:43, 10 August 2015 (UTC)
 * Done: the modules have been updated. Johnuniq (talk) 07:07, 15 August 2015 (UTC)

Unit is repeated with the multiplication sign
The use of the template to convert mm to in produces 7 x. Is there a way to delete the first unit-output, & the spaces, & get 7x40mm (.28x1.57in), instead? It would be very useful in metric ammunition designations. TREKphiler  any time you're ready, Uhura  18:41, 21 July 2015 (UTC)
 * See MOS ranges above. The problem is that the Manual of Style (MoS) says that abbreviations should be repeated when × is used—see WP:UNIT which includes "With the multiplication sign, each number should be followed by a unit name or symbol (if appropriate)." Perhaps ask at the talk page of WP:UNIT whether the guideline must apply for the example you mentioned, with links to one or more articles showing the issue. The question for MoS is whether those articles should repeat the unit, or whether an exception should be made due to [insert reason here]. I recently noticed Adrastea which includes "Adrastea has an irregular shape and measures 20×16×14 km across" as an example where WP:UNIT seems excessive. Johnuniq (talk) 22:32, 21 July 2015 (UTC)
 * Thx, I'll do that. In general, IMO the MoS gets it right, it just leaves templates unable to cope with the cases where the "general rule" doesn't apply.  TREKphiler   any time you're ready, Uhura  22:49, 21 July 2015 (UTC)
 * I would argue that the general rule does apply. Specialists is certain fields might use this convention or that but WP isn't written solely for the specialist. Jimp 08:55, 24 July 2015 (UTC)
 * And if there is a convention contrary to the MoS, the general rule of the MoS doesn't apply to it, does it? In this instance, the most common usage is interfering with a useful specialist application.  TREKphiler   any time you're ready, Uhura  14:26, 24 July 2015 (UTC)
 * re Trekphiler. MOS allows using 'by' this way: "7 by 40 mm (.28 by 1.57in)". -DePiep (talk) 22:17, 25 July 2015 (UTC)
 * Yes, but the ammo convention is to use the "x", so that's not a help.  TREKphiler   any time you're ready, Uhura  22:43, 25 July 2015 (UTC) (P.S. If you want to ping, just copy the whole username link; it should notify automatically.)
 * ... and no spaces, and no pre-zero in .28. AFAIK, ammo does not folow MOSNUM. MAybe it has its own MOS. Convert does not serve that exception. And, quite importnat, isn't ammo classified or normalised, not calculated? -DePiep (talk) 22:58, 25 July 2015 (UTC)
 * I confess you've lost me, now. As I'm understanding you, you mean the usual output of the template being a non-starter is a given, because it isn't meant to conform. What I'm asking for is a "variant model" that doesn't require manual calculation of the conversions every time an editor wants to go from metric to Imperial. (Take a look just at 8 mm caliber to get some notion how many pages, how many entries, are at issue.) Is it a "separate MoS"? Technically, no, AIUI; the MoS isn't really in touch with usual usage in the firearms community (since it still demands spaces between # & unit, to wit "9 mm", which no gun mag I've ever seen does). That's why I suggest this needs addressing.  TREKphiler   any time you're ready, Uhura  23:22, 25 July 2015 (UTC)
 * First the numbers: can calibres be calculated or are they defined? Then the formatting: yes you can ask so. ANd probably could produce that. But an ammo (calibre) formatting should be based on a MOS. (Sort of similar: track gauges are defined not measured). -DePiep (talk) 23:29, 25 July 2015 (UTC)
 * Again, I'm not completely clear how you mean "defined". Is the 9mm a dead-accurate measurement of the bore? Not usually. Is the case length? Yes. Do you mean we shouldn't bother to convert at all if both aren't dead accurate? That might be better, actually...but that appears to require a change in MoS--& certainly requires a change in attitude by uninformed editors, who will, I wager, continue to convert (template or no).  TREKphiler   any time you're ready, Uhura  00:48, 26 July 2015 (UTC)
 * One more try. Reading 9 mm caliber and 9×19mm Parabellum I get the impression that "9&times;19mm" is a name, not a size. The name does only refer to a size (or size range) and specifications, to be looked up. And a name we don't need to convert (that would be more like a translation, not a calculation). Also, being a name (and not a measurement or size definition), formatting is not prescribed by measurement formatting (like spacing, preceding 0). So the MOS rule for ammo would be like: "Caliber names are not converted. They may have non-measurement format". (Another checking question: is this 9&times;19mm ever being referred to as "(.28x1.57in)"? I mean, can one order it by that inches name?). Common unit conversion should be done when describing those specifications. -DePiep (talk) 09:36, 26 July 2015 (UTC)
 * ♠"One more try." I'm not usually this dense. :(
 * ♠You've gotten it, & I think we're agreed. In the case of, frex, the 9x19P, tho, the "19" is a measurement that bears converting...& that's why it's mentioned in the designation to begin with. Which is the problem I mentioned: people are going to want the case length (the 19mm) converted, & reasonably should.
 * ♠The other way, the .28x1.57", is extremely rare except in wildcats. (I can only think of one, the .308x1.5".) As said, tho, the 1.57" 19mm case length matters: it differs from the 25 mm of the 9mm Mauser or 23 mm of the 9mm Bergmann...& the 9x25 differs from the 9x57mm rifle round...all of which are {nominally} 9mm...) In Europe, the case length measure is a standard add (& you can see why ;p ); in the U.S. & Canada, it's (almost) all Imperial without case length.
 * ♠It's because of the highly common use of case length in European designations this arises at all. Since, as you point out, the caliber isn't (always) a true reflection of bore diameter, the conversion template probably shouldn't be used (& I agree), the issue of converting just the case length raises its own issues... Perhaps it should be 9x25 mm ?  TREKphiler   any time you're ready, Uhura  15:19 & 15:22, 26 July 2015 (UTC)
 * "I'm not usually this dense" - wtf does 'dense' mean? -DePiep (talk) 20:02, 26 July 2015 (UTC)
 * Just what it says: it doesn't usually take me so many passes to get it right...  TREKphiler   any time you're ready, Uhura  20:30, 26 July 2015 (UTC)
 * Whatever. What do you want, re format & conversion, by caliber? Is 9mm actually available by inches? -DePiep (talk) 20:51, 26 July 2015 (UTC)
 * Apparently, from the template, only removing the spaces; it's looking like this is something the MOS needs to address...but I don't want to move this whole thread there. (Not that anybody seems to be paying attention. : It looks like the solution is to use the template for the case length only: 9x25 mm, which gives this: 9x25 mm; for firearms, the space between "25" & "mm" is normally removed.  TREKphiler   any time you're ready, Uhura  00:21, 1 August 2015 (UTC)
 * ✅ I would also appreciate a way to do this; it's a convenient and sometimes preferred abbreviation. In China Jinping Underground Laboratory have to jump through some hoops to get "The design provides four experimental halls, each 14×14×130 m (14 m×14 m×130 m)." The default "14 ×" is so lengthy it really disrupts the flow of the text.  I can get no units, but I still get spaces around the multiplication signs, which is not wanted; it's the lack of spaces that emphasize that the multiplication binds tighter and the trailing units distributes across it.  I'd really like to be able to write about a "4×8 foot (4 ft×8 ft) sheet of plywood" or a "88×176×6 cm (88 cm×176 cm×6 cm) tatami". 71.41.210.146 (talk) 21:55, 15 August 2015 (UTC)

Possible Convert Problem?
Shouldn't "500 m" (ie, ) be MORE (*NOT* LESS) than "492 m" (ie,  ? - iac - Enjoy! :) Drbogdan (talk) 01:45, 24 August 2015 (UTC)
 * Convert is doing what is expected there, although it can cause surprises. The point is that 492 has three significant figures, whereas 500 has only one. Accordingly, convert (using Jimp's very clever algorithm) determines how to round the output. The  in the third of the following examples overrides the default to round the output to zero decimal places. The last example shows that a range is handled correctly—that provides a clue to convert that extra precision is wanted.
 * → 492 m
 * → 500 m
 * → 500 m
 * → 492-500 m
 * Johnuniq (talk) 02:16, 24 August 2015 (UTC)
 * Thank You *very much* for your comments - and *excellent* clarification - it's *greatly* appreciated - Thanks again - and - Enjoy! :) Drbogdan (talk) 13:07, 24 August 2015 (UTC)

Question
Is there any way to make this template work along with the 1/undefined template? --John (talk) 20:23, 25 August 2015 (UTC)


 * Convert already has fraction's output functions (per the documentation), so you must mean using Frac as an input. But no, I predict the maintainers will maintain that human input like


 * or.


 * (input as one field, with a + sign for a mixed numeral, and / or // for the bar) will be supported, while Frac's HTML output "" which is actually , won't be supported.


 * You might have to change a bunch of Fracs to Converts using "find and replace" functions? &mdash; Cp i r al  Cpiral  21:46, 25 August 2015 (UTC)


 * A lot of that was over my head, I am a novice user of both these templates, trying for fractional input in inches and decimal mm output. In the end I manually converted to decimal inches, captured the output from the convert template, then pasted it without the convert template and reinserted the fraction template to get my desired output. Strikes me there must be an easier way. --John (talk) 22:16, 25 August 2015 (UTC)
 * → 1+7/8 in or  → 1+3/4 in would do what you wanted.  Imzadi 1979   →   22:44, 25 August 2015 (UTC)
 * Thank you, User:Imzadi1979, that makes total sense. --John (talk) 22:47, 25 August 2015 (UTC)
 * For completeness, here is how to reverse the process with fractions in the output:
 * → 48 mm
 * → 44 mm
 * Johnuniq (talk) 02:21, 26 August 2015 (UTC)
 * Thank you! I knew there had to be a way. --John (talk) 09:56, 26 August 2015 (UTC)