Jump to content

Template talk:Convert/Archive June 2017

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


"million" in output

  • {{convert|2.5|e6acre|e6ha}} generates "2.5 million acres (1.0×10^6 ha)", but I'd like it to generate "2.5 million acres (1 million ha)" as the context is not a scientific article (Nullarbor plain). Is there a way to do this? {{convert|2.5|e6acre|e6ha|spell=on}} gives "two point five million acres (one point zero million hectares)" which isn't what I'm looking for. Thryduulf (talk) 14:31, 16 May 2017 (UTC)
Will {{convert|2.5|e6acre|e6ha|abbr=off}} "2.5 million acres (1.0 million hectares)" do? -- WOSlinker (talk) 15:50, 16 May 2017 (UTC)
Changing the "abbr" param to "out" instead of "off", to try to get the requested abbreviation "ha", has the interesting side-effect of changing the output back to scientific notation: "2.5 million acres (1.0×10^6 ha)". Is this intentional? Kendall-K1 (talk) 16:10, 16 May 2017 (UTC)
{{convert|2.5|e6acre|e6ha|abbr=off}} is close enough. Thanks. Thryduulf (talk) 17:32, 16 May 2017 (UTC)

@Thryduulf: A recent addition to the documentation reminded me that there is a way to do what you asked. The situation is that convert uses scientific notation for engineering notation if the output is abbreviated, and that is the default which is identical to abbr=out. Using spell=on sets a default of abbr=off and that is why "million" appeared above. A change in September 2016 introduced abbr=unit:

  • {{convert|2.5|e6acre|e6ha}} → 2.5 million acres (1.0×10^6 ha)
  • {{convert|2.5|e6acre|e6ha|abbr=unit}} → 2.5 million acres (1.0 million ha)
  • {{convert|2.5|e6acre|e6ha|abbr=off}} → 2.5 million acres (1.0 million hectares)

Johnuniq (talk) 04:27, 2 June 2017 (UTC)

Re: {{convert|m|ft|1|abbr=on}}

Hi all,

Apologies for what may be a silly question: is there a template conversion that can accommodate for this appearance?:

300 m
(984 ft)

As opposed to:

300 m (984.3 ft)

The article I'm working on –List of tallest buildings in Melbourne– uses the first format describ)ed in one of its tables, however the measurement conversion is done manually. I'm thinking of changing it to automatic conversion, however, I can only find a single style which is: 300 m (984.3 ft) -- and that really doesn't suit the table.

Kind regards, —MelbourneStartalk 14:13, 20 May 2017 (UTC)

From /doc##Table_options: |disp=br() adds the linebreak and keeps the brackets.
Adding |abbr=values omits the unit (not asked for here, but currently done in the article). Maybe add units for ease of reading? Then |abbr=on.
Rounding to zero decimal figures can be done by adding |4=0 (fourth unnamed parameter; where your example has "|1|").
So: {{convert|300|m|ft|0|disp=br()|abbr=on}} →
300 m
(984 ft)
Hope this helps. -DePiep (talk) 14:40, 20 May 2017 (UTC)
@DePiep: you're a gem! thank you so much. —MelbourneStartalk 03:34, 21 May 2017 (UTC)
MelbourneStar, to specifically get the appearance you were looking for, with small parentheticals, try this: {{convert|300|m|ft|0|abbr=on|disp=x|<br /><small>(|)</small>}}, which produces:
300 m
(984 ft)
Huntster (t @ c) 21:28, 2 June 2017 (UTC)

Usage of thousand separator: Use the space as IS/ISO 31-0 standard

Just to be better. Why we use a , for thousand separator? The IS/ISO 31-0 standard usage is a space, we can use &nbsp; to not having a carriage return in the middle of the number. Beeper (talk) 22:45, 1 June 2017 (UTC)

Convert simply follows the manual of style—see WP:DIGITS. Any discussion about whether to use commas should occur at the MOS page. It is possible to use gaps for a particular purpose where MOS can be disregarded—search the template page for "comma" to find |comma=gaps. Johnuniq (talk) 23:13, 1 June 2017 (UTC)
Thanks but this lead point to no discussion page. WP and MOS have no discussion page and I think that I'm not the only one concerns that english wikipedia is not using ISO standards. I'm trying to find something on wikipedia en and wikimedia for that point. I think, this is confusing the reader between . and , for decimal delimiter. Beside that, good job on the template. Beeper (talk) 21:21, 2 June 2017 (UTC)
When you click on WP:DIGITS you will arrive at a section within the "Manual of Style/Dates and numbers" guideline. If you navigate to the top of the page, you will see two tabs; the active one is "Project page" and the inactive one is "Talk". Click on the "Talk" page to discuss this.
By the way, my opinion is ISO charges exorbitant prices for standards. For example the ISO 8601 standard is only 41 pages and costs in the neighborhood of $100. I just ordered the National Electrical Code Handbook (also a standard) for $184 and that has 1304 pages. I think that projects like Wikipedia that prefer free publications and are run by volunteers participating at their own expense should turn their backs on ISO. Jc3s5h (talk) 21:59, 2 June 2017 (UTC)
OSI standards are already on wikipedia and you can read it (ISO_31-0). I just talk about best practices and internationalization. Use best standards in sciences and knowledge community. And wikipedia is in it. Don't make the same error than some aeronautics error occurred between imperial and metric system. This is just using , and . for decimals as you wish and thousand separator with space. Beside, I agree with you with the price... Beeper (talk) 22:56, 2 June 2017 (UTC)
No discussion page created there Beeper (talk) 02:33, 3 June 2017 (UTC)
Wikipedia is not a reliable source; there is no assurance the Wikipedia articles accurately reflect standards. Jc3s5h (talk) 02:15, 3 June 2017 (UTC)
LOL, you don't have confidence with the system you contribute! Beeper (talk) 02:32, 3 June 2017 (UTC)
Wikipedia is no reliable source, at least not for itself. This rule also exists in the German Wikipedia and I guess in a lot of other Wikipedias as well. The thousand seperator problem gets even more complicated when you come to Europe. Over here in Austria we use a dot as a thound seperator and a comma for what you would use a point for in English speaking countries, therefore, 1.000 and 1000 are the same while 1,234 and 1234 are not. That's why I usually use the swiss thousand seperator on German/Austrian topic articles and the standard small space on other Articles to definitely avoid confusion, it might appear weird on the first appearance but it is understood by Germans and Austrians: 1'234. However, accoording to DIN 1333 and ISO 80000, we should use a small space as Beeper suggested. The prices of ISO standards are not relevant, we want everyone to understand the Wikipedia. --Jojhnjoy (talk) 08:38, 3 June 2017 (UTC)

The proper discussion page is Wikipedia talk:Manual of Style/Dates and numbers. Jc3s5h (talk) 10:58, 3 June 2017 (UTC)

Template:Conv

Any thoughts about Template:Conv which was created by RingtailedFox in July 2014? It redirects to here. It is common to use shortcut names for templates with cumbersome titles, but is "conv" useful? I don't remember seeing it before although it is used in nearly 150 articles. Johnuniq (talk) 07:53, 7 June 2017 (UTC)

For the sake of three characters it is probably not a useful shortcut — Martin (MSGJ · talk) 08:28, 7 June 2017 (UTC)
Not just 3 characters diff. It also has preset |abbr=on, which is a setting used in ~50% of all {{Convert}} calls. -DePiep (talk) 08:53, 7 June 2017 (UTC)
If we are talking about {{cvt}}, then it's a very useful alternative, as DePiep says. Peter coxhead (talk) 10:05, 7 June 2017 (UTC)
My mistake. The redirect could be TfD'ed, to prevent any such confusion ;-). -DePiep (talk) 10:23, 7 June 2017 (UTC)
I created Template:conv as a redirect becuase I saw a TON of articles using it, yet it was redlinked (because there was no such article), so i figured this would fix it. If you guys want to delete or redirect it, go for it. I just figured it was an efficient and simple solution. RingtailedFoxTalkContribs 21:46, 14 June 2017 (UTC)
Thanks. Perhaps Template:Conv is used on another project and some articles were created here by copying wikitext from the other project. That would explain why red-linked templates occurred. Or, someone might have done some fast editing and thought that "conv" worked, whereas "convert" was actually needed. Johnuniq (talk) 03:48, 15 June 2017 (UTC)

Alias Conv could allow Lua Convert in more languages

The 2014 precedent for alias "{conv}" allows an excellent head-start to further implement Lua Convert in other-language Wikipedias where their "{convert}" has been locked-in as a wikitext markup version. For example, Spanish eswiki redirects "{convert}" to template es:Plantilla:Convertir (big-switch version) with limited units, but new Plantilla:Conv could be the Lua Convert being installed as Spanish parameters and unit-names to allow both prior and Lua conversions in eswiki pages. Because {conv} has been used over 4 years here, it could be identified as an enwiki alternative conversion system, without derailing the other-language versions at their traditional "{convert}" system fork. Copying {conv} texts to enwiki would generate similar results as on the other-language wikipedias. Conv then allows the best of both worlds, in each language. -Wikid77 (talk) 05:16, 15 June 2017 (UTC)

Miles and chains

It would be great if the template could output a conversion into miles and chains. 81.229.44.57 (talk) 22:41, 16 June 2017 (UTC)

Can you give references to sources that state distances in miles and chains? Jc3s5h (talk) 22:50, 16 June 2017 (UTC)
There are plenty, but input in miles and chains is not a problem. Output is the problem. 81.229.44.57 (talk) 10:04, 17 June 2017 (UTC)
Both miles+chains are used in railway distances, such as in Wales [1] even in 2000/2008. One mile is 80 chains. -Wikid77 (talk) 12:56, 20 June 2017 (UTC)
I can personally attest that miles and chains were being used in the rail maintenance industry on the Euston-Birmingham rail line as of 2007. Rhialto (talk) 13:53, 20 June 2017 (UTC)
Chains can be used with miles, yards or feet for input, but there is no provision to show a combination output such as miles and chains. Examples for input:
  • {{convert|1|mi|2|ch|7|ft}} → 1 mile 2 chains 7 feet (1.652 km)
  • {{convert|2|ch|7|yd}} → 2 chains 7 yards (47 m)
As Jc3s5h mentioned, a change to convert would need good examples showing the need. Johnuniq (talk) 00:22, 17 June 2017 (UTC)
What's the problem with adding something just because it exists? Would additional functions make the template worse? How do we know if certain functions will / won't be used in the future? Some units are common in literature but not in the Wikipedia, apparently this is reason enough for not adding them which basically renders giving any examples for the need useless. You have proven ignorance in the past already. --Jojhnjoy (talk) 09:08, 17 June 2017 (UTC)
I can understand why we need to translate from miles, chains and feet - mostly for older references that list measurements in those units and need to be translated into modern units. But why would you want to translate to those units? Does anybody think in chains any more? To add more units that are not used causes the convert module to be bloated, slower and harder to maintain. The last point is especially important for a non-trivial (and for metric thinkers, downright weird) unit like chains that somehow has to fit in with miles, yard, feet and inches. It's asking a lot for the module maintainers to wend their way through the maze of convoluted imperial units without mistakes - no need to make it harder for a unit that has such little need. You may as well ask for measurements in furlongs per fortnight and the Potrzebie system.
In Britain, railways have traditionally been measured in miles and chains. It would be nice to be able to convert the length of modern british railways and tram systems (which are designed in SI-units and measured in kilometres) to miles and chains instead of only miles for those who still use imperial units. 81.229.44.57 (talk) 10:16, 17 June 2017 (UTC)
If you would want to convert from miles etc. to something more modern, I assume that metres are the best choice. From the radius of a hair to the distance between Earth and Moon, the metre is the best choice due to the SI-prefixes. However, if you would want to convert from miles and chains to miles, it would not help anything in my opinion, since you would most likely use something like feet or yard instead which leaves you with the same problem, having several different units at once for one length. The only reason to convert to these units is for historical reasons as mentioned by the IP. This makes sense for railway track for instance, since its width is 4'8½", even in countries like Germany. --Jojhnjoy (talk) 12:56, 17 June 2017 (UTC)
I completly agree that metres (with prefixes) are far superior to the archaic imperial and US systems and I'd love to see the few countries that still prefer complicated medieval units to join the modern world and adopt an easy to use and simple system. But, until they do we have to deal with both, hence the need for this template. As I mentioned, railways are traditionelly measured in miles and chains in the UK. But modern railways are measured in kilometres. That leads to a situation where old lines have their length written as 8 miles 15 chains (13.2 km), but new lines as 55.3 kilometres (34.4 mi), it would be nice if the template could output the latter as 55.3 kilometres (34 mi 32 ch). Yes, it is only in a very specific area where the unit is used. But so is the case with the hand, which the template does handle. 81.229.44.57 (talk) 13:25, 17 June 2017 (UTC)
As described, the template does convert from chains all fine. Also, there is the question: "when would the reverse (mi into ch) be needed?". All short: no convincing examples provided. 'would be nice' is not enough. -DePiep (talk) 23:10, 17 June 2017 (UTC)
I'm just a bystander, but it seems that our IP friend is saying that kilometers should be able to be converted to miles and chains so that the lengths of railway lines that are measured in kilometers can be compared with those (outside Wikipedia, perhaps?) that are measured in miles and chains. That sounds plausible at least. — Eru·tuon 01:24, 18 June 2017 (UTC)
There is {{miles-chains}} for some reason? Thanks! Plastikspork ―Œ(talk) 01:31, 18 June 2017 (UTC)
I had forgotten about that—it is used in 14 articles. It has the feature of only linking chains whereas using convert would require no links, or linking both miles and chains. For example, at Austin 7#Gordon England:
  • {{miles-chains|80|mi|0|chain|km}} → 80 miles 0 chains (80.00 miles, 128.75 km)
  • {{convert|80|mi|0|ch|km|lk=in}} → 80 mileschains (128.7 km)
Johnuniq (talk) 02:01, 18 June 2017 (UTC)

@81.229.44.57: Thanks for the "55.3 kilometres (34.4 mi)" example, but please provide an example of text in an article where the convert would help. Preferably, provide links to two articles and quote a short piece of text that would benefit from the convert. Or, what text would be added to what article where? I asked for thoughts at WT:WikiProject Trains#Miles and chains. Johnuniq (talk) 01:54, 18 June 2017 (UTC)

For instance, if the length of a historical railway track is given in kilometres in the source, we would need to convert to miles and chains to cover the historical aspect. --Jojhnjoy (talk) 07:35, 18 June 2017 (UTC)
Thanks, but that is what the IP said. Rather than a hypothetical case where convert might be useful, it is reasonable to ask for an example in an article, as in my comment. Johnuniq (talk) 08:12, 18 June 2017 (UTC)
As I mentioned, that depends on the source rather than the article itself. For instance, this BMW E12 catalgue has SI units for power and torque, but since the E12 was introduced before 1978, you would want to display power and torque in the according article using units of the technical unit system (PS and kp·m) as they belong to that vehicle for historical reasons. By the way that is still no possible due to the lack of the kilopondmetre in the convert template. In the given example the source also gives the technical units but you would also encounter sources that don't list historical units anymore, this is especially true for East German literature due to the replacement of technical units in the DDR in 1970. --Jojhnjoy (talk) 10:40, 18 June 2017 (UTC)
Seriously, what part of "please provide one or two examples" is difficult to understand? I doubt a single person alive today has ever thought, "If only this measurement was expressed in chains, I might understand it." Chains are a measurement to convert from, not to convert to. If they don't exist in the source but you think they should, find a better source. Likewise for horsepower vs KW. Wikipedia is not the place for recreating old sources out of other ones. SilverbackNet talk 22:40, 18 June 2017 (UTC)
We asked for examples the last time this came up, and none were provided then either. Template talk:Convert/Archive May 2017#Kilopondmetre Kendall-K1 (talk) 01:44, 19 June 2017 (UTC)
Units given in sources depend on the several different things and that the units given don't determine the quality of a source, therefore I highly doubt that finding a better source would give better units. The last time this came up you safely ignored everything I explained and provided. More than hundereds of articles use the Kilopondmetre but the template still lacks it. You also have to keep in mind that a bunch of articles has to be corrected since the technical data was converted wrong, yesterday I started with the BMW E12. The most reliable sources for any non American historical vehicles use technical units. Providing these original technical units is the most accurate way of providing information in articles properly. Both in the German and English Wikipedia I encounter the problem of wrong unit conversions done either by Wikipedia or external source authors. For instance, 16,5 kp·m are often "converted" as 165 N·m and 1000 hp as 1000 PS. Therefore using the original units and converting them is the safest way without running into any trouble. The original units depend on the country, time period, laws and technical aspects. The use of historical units provides a better expression of the topic. For instance, some gearboxes have names according to their input torque in Kilopondmetres and some engines have names according to their displacement in Cubic Inches. If one can't find any source providing historical units which would fit the topic though, converting from superior SI units to these units is a good way of expressing the topic for the reader. For example my favourite combine harvester is a German vehicle but it has a Perkins 6.354 engine – explaining that the engine has a displacement of 354 in³ makes sense in this case. People also use the convert template to convert Watt to Horsepower and Metres to Feet. If this is not a problem, I would also allow a conversion from Metres to Chains since the "logic" behind Chains, Miles, Yards, Feet and Inches is the same. --Jojhnjoy (talk) 09:09, 19 June 2017 (UTC)

Rare outputs can use order=flip

The use of miles and chains has been common in surveying and equestrian events, such as a racetrack or dressage ring (1 by 2 chains or 20 by 40 metres). Anyway, outputs can be formatted by "order=flip":

  • {convert|1|chain|ft m} —> 1 chain (66 ft; 20 m)
  • {convert|3|mi|22|ch|m|0} —> 3 miles 22 chains (5,271 m)
  • {convert|3|mi|22|ch|m|0|order=flip} —> 5,271 metres (3 mi 22 ch)

Remember to set precision level "|0" or the result could be off by 49 metres (2.4 chains), due to the severe over-rounding in Lua {convert} during 2017. -Wikid77 (talk) 06:16, 19 June 2017 (UTC)

Rutherford unit

I wish to add a unit for conversion in the Module:Convert/data page but lack the permissions. If someone could give me the permission it would be great, otherwise the unit is the non-SI Rutherford (unit) and should be placed next the entries of Bq and Ci. -- Sjschen (talk) 14:51, 22 June 2017 (UTC)

@Sjschen: You can add it in Module:Convert/extra and then if it gets used it will be migrated over to Convert/data later on. -- WOSlinker (talk) 18:26, 22 June 2017 (UTC)
The above is copied from Module talk:Convert because units should be discussed here.
A problem is that unit rd exists (see Rod (unit)). It would be fine to use unit code Rd but it would be helpful if GliderMaven were to comment and add the unit to Module:Convert/extra if it is likely to be used. Johnuniq (talk) 23:20, 22 June 2017 (UTC)
I was going to add conversion to the units in
Ionizing radiation related quantities
Quantity Unit Symbol Derivation Year SI equivalent
Activity (A) becquerel Bq s−1 1974 SI unit
curie Ci 3.7×1010 s−1 1953 3.7×1010 Bq
rutherford Rd 106 s−1 1946 1000000 Bq
Exposure (X) coulomb per kilogram C/kg C⋅kg−1 of air 1974 SI unit
röntgen R esu / 0.001293 g of air 1928 2.58×10−4 C/kg
Absorbed dose (D) gray Gy J⋅kg−1 1974 SI unit
erg per gram erg/g erg⋅g−1 1950 1.0×10−4 Gy
rad rad 100 erg⋅g−1 1953 0.010 Gy
Equivalent dose (H) sievert Sv J⋅kg−1 × WR 1977 SI unit
röntgen equivalent man rem 100 erg⋅g−1 × WR 1971 0.010 Sv
Effective dose (E) sievert Sv J⋅kg−1 × WR × WT 1977 SI unit
röntgen equivalent man rem 100 erg⋅g−1 × WR × WT 1971 0.010 Sv
to SI, so ideally Rutherford would be there too. How do we handle collisions of Unit abbreviations? -- Sjschen (talk) 16:16, 23 June 2017 (UTC)
There is no problem with adding Rutherford as WOSlinker mentioned. I'm working on convert at the moment, although it is happening off-wiki as it involves boring tests and documentation, but I'll be back looking at what you're saying in detail soon. If you only need Rutherford in one table, consider not using the convert template. Use it if desirable, but if just showing conversion equivalents I'm not sure that it wouldn't be better to quote values from some text book. However, that's just a suggestion.
In {{convert}} jargon, each unit is identified with a unit code which is the wikitext needed in the convert template. For example, rd identifies Rod (unit). It would be fine to use Rd as the unit code for Rutherford (unit), particularly because there is very little chance of an article using both. I mentioned rd to say that cannot be used. A unit abbreviation is the symbol that is displayed for a unit if |abbr=on (abbreviation on) applies. If there is a collision problem, please explain. Johnuniq (talk) 00:02, 24 June 2017 (UTC)
I only just got the message on my talk page. Yes, it seems straightforward. Where's it going to be used though?GliderMaven (talk) 01:49, 24 June 2017 (UTC)
Apparently the only usage planned at the moment is for the table above (Template:Radiation related quantities). As I mentioned just above, I'm not sure how helpful convert would be in that situation. Johnuniq (talk) 23:17, 25 June 2017 (UTC)
It's a somewhat rare unit but stylistically it feels better to have it done through a template than manually punching it out as a string of text. I'll add it soon if this is not really an issue.-- Sjschen (talk) 13:14, 26 June 2017 (UTC)
I added the unit. I don't know if SI prefixes are likely to be used but there is no harm in allowing them. Examples:
  • {{convert|1|Rd|Bq|abbr=off|lk=on}} → 1 rutherford (1,000,000 becquerels)
  • {{convert|1|MRd|Ci|abbr=on}} → 1 MRd (27 Ci)
  • {{convert|1.23|kRd|MBq|abbr=on}} → 1.23 kRd (1,230 MBq)
Johnuniq (talk) 23:43, 26 June 2017 (UTC)

Plurals

In the following extract from the Gallaudet University page, the measurement should show the unit name (acre) in the singular instead of the plural that is actually displayed: "located in Washington, D.C., on a 99 acres (0.40 km2) campus." This is the same usage as saying "a 30 meter yacht" as opposed to "a yacht measuring 30 meters". Is there a way to fix this? --Khajidha (talk) 13:36, 28 June 2017 (UTC)

Found it. "adj=on". --Khajidha (talk) 13:43, 28 June 2017 (UTC)
@Khajidha: the other difference is that |adj=on also hyphenates the number to the unit name because "99-acre" is a compound adjective. There is also |adj=mid to allow something "a 30-metre-long (98 ft) yacht" to properly render the full compound adjective. Imzadi 1979  20:19, 28 June 2017 (UTC)