Template talk:Convert
|
Template:Convert is permanently protected from editing because it is a heavily used or highly visible template. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit. Usually, any contributor may edit the template's documentation to add usage notes or categories.
Any contributor may edit the template's sandbox. Functionality of the template can be checked using test cases. |
|
|||
This page has archives. Sections older than 42 days may be automatically archived by Lowercase sigmabot III when more than 2 sections are present. |
Related pages |
---|
Linear feature density
editAt Transport in Switzerland#Railways I've found a need to convert 122 km/1000 km2 into imperial (probably something like miles per 100 or 1000 sqmi). Is this something convert can handled? In the article I've gone with separate conversions to come up with 76 mi per 390 sq mi which is not ideal. Thryduulf (talk) 16:58, 19 July 2024 (UTC)
- Best I can find is
{{cvt|0.122|km/km2|mi/sqmi|3}}
to display as 0.122 km/km2 (0.196 mi/sq mi) - In theory we should be able to use e3km2 and e3sqmi but these don't work. Stepho talk 17:22, 19 July 2024 (UTC)
- Similarly at List of prominent mountains of Switzerland#Distribution there is
approximately 1.09 summits per 100 km2
that I've just left as I can't work out anything sensible (I don't think 0.0109/km2 (0.028/sq mi) is particularly useful). Thryduulf (talk) 17:36, 19 July 2024 (UTC)
- Found a really clumsy and dirty technique:
{{cvt|122|mi|km0|abbr=values|disp=preunit|km/1000 km<sup>2</sup>|mile/1000 sq mile}}
displays as 122 km/1000 km2 (196 mile/1000 sq mile) - This relies on km/km2 converting to mi/sqmi being the same ratio as mi to km - ie km/km2 is same as 1/km and 1/km -> 1/mi being the same ratio as mi -> km. Dirty, very dirty.
- Sadly, this trick doesn't work for summits per area. Stepho talk 17:57, 19 July 2024 (UTC)
- Found a really clumsy and dirty technique:
- If there were a heap of these, new units for "1000 km2" and "100 sqmi" and "100 km2" could be defined. I'm not sure how clean the result would be but it might be reasonable. Johnuniq (talk) 03:20, 20 July 2024 (UTC)
Template-protected edit request on 8 August 2024
editThis edit request has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Suggested change: It is somewhat common in radio frequency, radar, microwave, infrared, light wave electromagnetic radiation studies and applications to convert frequency values (expressed in Hertz) into wavelength values (expressed in meters). The frequency values will be in units of Hz, kHz, MHz, GHz, and so on. For a full list of the most common possibilities, see Hertz § SI multiples.
Applicable uses: Such functionality would be very helpful in multiple (hundreds or more) articles that discuss things like "operating frequency", "transmission frequency", and the like in many situations. But in Template:Convert, there is no such calculation.
Formulae: A great discussion of the mathematics involved can be found at the Everything RF site.
Syntax/Results: The result of the conversion template should be something like this for {{Convert|2700|MHz|m|abbr=on}}
:
- 2700 MHz (0.111 m)
Alternatively, for {{Convert|0.099|m|MHz|abbr=on}}
result should look like this:
- 0.099 m (3019 MHz)
Please let me know if there's anything more I can provide to help.
Thanks — TadgStirkland401 (TadgTalk) 19:57, 8 August 2024 (UTC)
- @TadgStirkland401:
Not done for now: please establish a consensus for this alteration before using the
{{Edit template-protected}}
template. The calculation is simple, it's where: is the wavelength in metres; is the speed of light in metres per second; and is the frequency in Hertz. But where has this been discussed? --Redrose64 🌹 (talk) 20:25, 8 August 2024 (UTC)- @Redrose64, thank you for the quick response. But please let me explain, as no malice was intended. When I go to the View Source tab of the template, I'm informed it is protected, and rightfully so. I immediately see the following message (with my thoughts between the bullets):
- What can I do?
- This template has a documentation page – Template:Convert/doc – and a sandbox page – Template:Convert/sandbox – both may be freely edited.
- Tadg: I didn't think this would effect the necessary change.
- Discuss this page with others.
- Tadg: The last bullet below seems to do both in one move.
- For move-protected pages, see requested moves.
- Tadg: My request has nothing to do with a "move" action.
- Request that the page's protection level be reduced.
- Tadg: I am not able to rationalize the change to the template myself, so unprotecting it did not meet the need.
- Find out more about how to get started editing Wikipedia.
- Tadg: I am well aware it is beyond my skill level, but I don't need to go the the Help:Introduction page on this one.
- If you have noticed an error or have a suggestion for a simple, non-controversial change, you can submit an edit request by clicking the button below and following the instructions. An administrator or template editor may then make the change on your behalf. Please check the talk page first in case the issue is already being discussed.
- Tadg: This seemed like the most rational choice that I was given. You admitted this change was simple, and it is completely non-controversial, so I moved to the last part of the bullet. I checked the Template talk:Convert page, and found no discussion remotely like what I intended. So, I clicked the request button and followed the Template:Edit template-protected instructions to the letter.
- This template has a documentation page – Template:Convert/doc – and a sandbox page – Template:Convert/sandbox – both may be freely edited.
- I tried hard not miss anything in the process. My edit request serves the purpose of the second bullet by opening the discussion. I am more than willing to wait for the ensuing discussion before any action is taken. I certainly did not intend to offend anyone. — TadgStirkland401 (TadgTalk) 22:50, 8 August 2024 (UTC)
- Wikipedia:Edit requests is explicit: Requests should be accompanied by a clear and specific description of the requested change, and consensus should be obtained before requesting changes that are likely to be controversial.
- I said that the calculation is simple, I didn't say that the coding is simple. The
{{convert}}
template is a wrapper for Module:Convert, which itself is the front-end for a whole set of modules written in Lua, a programming language that I have difficulty with. These modules are complex and interdependent, it is essential that any change be thoroughly tested before being put live, as each change to a live module will put 1.2 million pages into the job queue for reparsing, and this can take several days. If an error is found after a change is put live, it might be the work of minutes to fix it, but then those 1.2 million pages will exhibit the error until they've all been through the job queue a second time, which can take several more days. This risk is why it's controversial. --Redrose64 🌹 (talk) 23:46, 8 August 2024 (UTC)
- Convert supports a large number of units (see full list). A discussion in March 2015 ended up adding
Hz
as a strange unit of length. These work:{{convert|0.099|m|MHz|abbr=on}}
→ 0.099 m (3,000 MHz){{convert|0.099|m|MHz|0|abbr=on}}
→ 0.099 m (3,028 MHz){{convert|2700|MHz|m|abbr=on}}
→ 2,700 MHz (0.11 m)
- Johnuniq (talk) 00:00, 9 August 2024 (UTC)
- @Johnuniq, that is perfect! Just tried it in my sandbox, and it works exactly as expected. Thank you SO MUCH. Since 2015 was a long time for it not to appear yet in the documentation, and /doc is not protected, should I take the initiative to update it accordingly? Or is that already on someone’s plate? — TadgStirkland401 (TadgTalk) 06:09, 9 August 2024 (UTC)
- Have a go if you like but the problem is that the documentation is already too long and many units are not listed there. Somewhere it says that, with a link to the full list of units. Johnuniq (talk) 08:15, 9 August 2024 (UTC)
- Interesting idea. But is this really some thing {{convert}} should do? Most physicists would use wavenumber instead, which is inverse wavelength. (Actually, often, 2pi/wavelength.) Since c is now defined, and the meter based on c and a time unit, should convert allow conversions between length and time? (Does it?) Note that MeV is often used as a mass unit, though technically is an energy unit. Should convert, in general, allow conversion between mass and energy units?
- OK, so this question brings up two thing: conversions based on powers of c, and reciprocal conversions. Reciprocal conversions exist, such as mpgus to L/km. It might be nice for MeV to g or kg to work. Gah4 (talk) 22:25, 23 August 2024 (UTC)
- @Johnuniq, that is perfect! Just tried it in my sandbox, and it works exactly as expected. Thank you SO MUCH. Since 2015 was a long time for it not to appear yet in the documentation, and /doc is not protected, should I take the initiative to update it accordingly? Or is that already on someone’s plate? — TadgStirkland401 (TadgTalk) 06:09, 9 August 2024 (UTC)
OK, I just checked it. Conversions such is {{convert|10|GeV|g}}
and {{convert|1|m|s}}
don't work. Much physics would be easier to describe if these worked. Maybe in general these aren't a good idea, but they are in physics. Maybe a special option could allow them? Or do we need a special {{physicsconvert}}? Gah4 (talk) 23:08, 23 August 2024 (UTC)
- It might be better to keep convert relatively simple where, for example, it cannot convert between length and time. That catches bad edits with typos or vandalism. Johnuniq (talk) 03:13, 24 August 2024 (UTC)
- Personally, I think people shouldn't be so far off, but yes that might be a good idea. The is why I suggest a new template that allows physics-like conversions. That would also include the one that started this thread. Gah4 (talk) 04:58, 24 August 2024 (UTC)
Discrepancy between Template:Km2 mi2 & Template:Convert
edit You are invited to join the discussion at Template talk:Km2 mi2. Peaceray (talk) 21:09, 13 August 2024 (UTC)
Grammatical problem
editAt Lake Casitas#Operations, there is a conversion that is grammatically incorrect, and I'm wondering if there's a way to fix it. Whoever put the conversion in wanted it to read "x acre-feet of water" before the conversion, but as you can see, existing options do not seem to allow for that sort of construction. Thanks! 1980fast (talk) 21:57, 28 August 2024 (UTC)