Template talk:Convert/Archive April 2019
{{Talk archive}}
Proposal: energy to temperature
In solid state, condensed matter and high-energy physics, it's common to convert between energies and temperatures (particularly energies in electron-volts; temperatures chiefly in kelvin) via the Boltzmann factor. An absolute temperature multiplied by yields an energy, and an energy divided by yields a temperature characteristic of that energy. There's already some non-obvious uses, such as
yielding {{cvt|600|nm|THz}}, using the speed of light, another fundamental physical constant. --Daviddwd (talk) 00:27, 4 April 2019 (UTC)
:A discussion in July 2018 concluded that such a conversion would be problematic. The issues mentioned there would need to be addressed. Also, we would need to see the text in a few articles where convert might be useful (please supply links). Johnuniq (talk) 00:41, 4 April 2019 (UTC)
:: OK. I don't have an immediate solution for those issues, but here are a few articles:
::* Neutron temperature.
:: I could find more. Thank you for the information. I'm ok with keeping things how they are now. I'll bring it up again if I find what I consider sufficient reason. Thanks again! --Daviddwd (talk) 01:19, 4 April 2019 (UTC)
Force add a reference citation on the unit to be converted instead of the converted unit when using <code>disp=table</code>?
When using the parameter disp=table
on a wikitable, is there a way to force the reference citation to be added on the first column (the original unit to be converted) instead of the second column (converted unit):
class="wikitable" scope="col" | City ! scope="col" | Population (2015)
! scope="col" | Area (sq. km.)
! scope="col" | Area (sq. mi.)
scope="row" | Cavite City | {{nts|319,104}}
| {{convert|10.89|km2|mi2|disp=table}}Example reference.
class="wikitable" |
scope="col" | City
! scope="col" | Population (2015) ! scope="col" | Area (sq. km.) ! scope="col" | Area (sq. mi.) |
---|
scope="row" | Cavite City
| {{nts|319,104}} | {{convert|10.89|km2|mi2|disp=table}}Example reference. |
As can be seen from above, the template adds the citation (
) on the converted square mile column (Area (sq. mi.)
) instead of the square kilometer column (Area (sq. km.)
). I tested order=flip
can be used as a workaround but it would mess up the table and make it difficult to understand. Can we force the citation to be added on the unit to be converted (Area (sq. km.)
) column? –Sanglahi86 (talk) 02:35, 4 April 2019 (UTC)
{{reflist-talk}}
:Yes, put the reference immediately after 10.89 (so it would read "
:: Thank you very much for the information. Perhaps this useful info should be added to the documentation? Thanks again. –Sanglahi86 (talk) 05:35, 4 April 2019 (UTC)
Multiple units for power and speed
It's sometimes useful to have the possibility of choosing the right order for multiple units for power and speed: e.g. 275 kW (374 PS; 369 bhp). With the present system I would get something like that 374 PS; 369 bhp (275 kW) which is not the best way to present it. Same for speed, especially for wind which can be measured in km/h, m/s, mph and knots. Is there a way to work around this? Thanks.--Carnby (talk) 17:20, 6 April 2019 (UTC)
:No problem, the mysterious order=out option can be used to specify the order in which the units should be displayed.
:*
→ {{convert|275|kW|PS kW hp|abbr=on|order=out}}
:Johnuniq (talk) 23:05, 6 April 2019 (UTC)
::Beware that most articles (but not all) should be metric first.
::*
→ {{convert|374|PS|kW hp PS|abbr=on|order=out}}
:: Stepho talk 00:46, 7 April 2019 (UTC)
:::What? According to what policy/guideline?
:::—Trappist the monk (talk) 01:21, 7 April 2019 (UTC)
::::I was under the impression that the first unit which appears should be the units the cited reference uses, the units in parens being conversions from the original specification. But in this case you're already going out of your way to present them out-of-order, so it's probably more a matter of what units the overall article is using. In general, hopefully that's metric because that's what most of the world uses, but when the article is based around non-metric units (such as U.S. highway speed limits), that won't be the case. Tarl N. (discuss) 01:29, 7 April 2019 (UTC)
:::::WP:UNITS lists a couple of exceptions for the US and UK and then states "In all other articles, the primary units chosen will be SI units". I know Carnby makes edits to automobile articles and WP:CARUNITS says pretty much the same thing.
:::::I always used the units in the reference as the input to convert and then use {{para|order}} to rearrange to the desired order. In fact, '|disp=flip' (the predecessor of {{para|order}}) was originally added many years when I requested a way to change the order while still using the units from the reference as input. Stepho talk 01:45, 7 April 2019 (UTC)
:Excellent, thank you very much!--Carnby (talk) 10:47, 7 April 2019 (UTC)
= Sorting with data-sort-value ready for test =
Use {{tl|convert/sandbox}} to test the new sort keys per above. For simplicity, convert outputs an empty span before the displayed text. I believe that is now ok. The following shows some converts and the output from Special:ExpandTemplates.
{{convert/sandbox|12.34|m|sortable=on}}
12.34 metres (40.5 ft)
{{convert/sandbox|12.34|m|sortable=debug}}
7001123400000000000♠12.34 metres (40.5 ft)
{{convert/sandbox|12.34|m|sortable=on|disp=table}}
style="text-align:right;" data-sort-value="7001123400000000000"|12.34
|style="text-align:right;" data-sort-value="7001123400000000000"|40.5
{{convert/sandbox|12.34|m|sortable=debug|disp=table}}
style="text-align:right;" data-sort-value="7001123400000000000"|700112340000000000012.34
|style="text-align:right;" data-sort-value="7001123400000000000"|40.5
@TheDJ: Is the above ok? I will post a similar example at Template talk:Val#Sorting will use data-sort-value and will do a similar fix for Module:Age later. A related discussion with information on sort keys is at Help talk:Sorting#Exclamation mark. Johnuniq (talk) 10:41, 21 April 2019 (UTC)
:{{u|Johnuniq}}, seems good to me. —TheDJ (talk • contribs) 17:55, 29 April 2019 (UTC)
::OK, I'm moving to update convert + val + age in the near future but am browsing my todo list wondering whether to look at anything else. Johnuniq (talk) 23:54, 29 April 2019 (UTC)
:::Very useful job, thanks! — JFG talk 07:17, 30 April 2019 (UTC)
Acres
I noticed there is no abbreviation in the template for acres. This is actually incorrect. Acres is commonly abbreviated as ac. This is on the page for acres as well as on the wikidata link provided on the table of units. Could someone fix this? NoahTalk 00:31, 30 April 2019 (UTC)
:What acre says about "ac" being the symbol for acre is not definitive. I can't find any previous discussions on the issue but it has been accepted for many years that writing ac instead of acre is not helpful as there is no significant space saving and ac is not a familiar term. Is there an article where ac is required? Johnuniq (talk) 01:50, 30 April 2019 (UTC)
::Could ac be used in the template as an alternative unit code, so
:::How would that help? Everyone knows what "acre" is. By contrast, "ac" would cause a lot of head scratching. We assume that people have had a basic education and know that kg and kilogram are the same thing, but ac is not familiar to a lot of people. Johnuniq (talk) 23:30, 30 April 2019 (UTC)