Jump to content

Template talk:Convert

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
(Redirected from Help talk:Convert units)

... in conception
... and in reality

Linear feature density

[edit]

At 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)[reply]

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)[reply]
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)[reply]
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)[reply]
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)[reply]

A similar issue arises at Scandinavian mountains#Climate, permafrost and glaciers where there is a need to convert "1.17 °C /100 m" but the logical {{convert|1.17|C-change/e2m}} gives an error (1.17 C-change/e2m[convert: unknown unit]). A quick search suggests that "°C /100m" (with that exact spacing) is used in at least three other articles. Thryduulf (talk) 11:30, 12 September 2024 (UTC)[reply]

Grammatical problem

[edit]

At 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)[reply]

It is possible, but it's ugly. The following shows what is currently in the article (first line) and what could be done (second line). I think the current convert is fine but it's your choice.
  • up to {{convert|107,800|acre.ft|m3|abbr=off|sp=us}} of water per year → up to 107,800 acre-feet (133,000,000 cubic meters) of water per year
  • up to {{convert|107,800|acre.ft|m3|disp=x| of water (|)|abbr=off|sp=us}} per year → up to 107,800 acre-feet of water (133,000,000 cubic meters) per year
See Help:Convert#Extra words. Johnuniq (talk) 04:38, 29 August 2024 (UTC)[reply]
Thanks! Actually, the current wording is indeed fine, because someone else fixed it already. It didn't look like the first line when I asked the question! :) I'd link to the revision that I saw, but I don't know how to do so.
I do have one question about your second line: what's the function of the pipe character in parentheses? 1980fast (talk) 19:48, 29 August 2024 (UTC)[reply]
@1980fast: Compare this:
  • up to 107,800 acre-feet of water (133,000,000 cubic meters) per year
with this:
  • up to 107,800 acre-feet of water 133,000,000 cubic meters per year
As you can see, it encloses the conversion in parentheses. --Redrose64 🌹 (talk) 20:37, 29 August 2024 (UTC)[reply]
To clarify further, it's not a "pipe character in parentheses", the pipe char separates the parameters " of water (" and ")". The first string goes before the converted quantity and the second goes after. Indefatigable (talk) 20:47, 29 August 2024 (UTC)[reply]

bug in ranges

[edit]

{{cvt|3.1|–|3.2|m|ft}} yields 3.1–3.2 m (10–10 ft) which is nonsense (it should be 10 ft). 2A06:C701:4F01:3E00:954F:E3C4:701B:2467 (talk) 15:52, 3 September 2024 (UTC)[reply]

It's designed so that if a range is fed in, a range will always come out. If you increase the precision, you will notice that the output does vary:
  • 3.1–3.2 m (10–10 ft)
  • 3.1–3.2 m (10–10 ft)
  • 3.1–3.2 m (10.2–10.5 ft)
  • 3.1–3.2 m (10.17–10.50 ft)
  • 3.1–3.2 m (10.171–10.499 ft)
  • 3.1–3.2 m (10.1706–10.4987 ft)
HTH. --Redrose64 🌹 (talk) 16:21, 3 September 2024 (UTC)[reply]

Combining multiple components with ranges

[edit]

Is it possible to combine the "multiple components" form, like {{convert|11|ft|2|in|m}} and {{convert|4|ft|5|in|m}}, with the "range" form? The only way that I've found that works is {{convert|11+2/12|x|4+5/12|ft|m|abbr=on}} - this gives 11+212 ft × 4+512 ft (3.4 m × 1.3 m) which is technically correct, but not ideal. --Redrose64 🌹 (talk) 15:23, 29 September 2024 (UTC)[reply]

Sorry, no. The multiple units like feet/inches can have several components (miles, chains, ...) and making them work with a range was beyond me. However, if desperate, there is a dirty trick which I can't really recommend but which gives a reasonable result in this case:
  • {{convert|3.40|x|1.35|m|ftin|order=flip}} → 11 feet 2 inches by 4 feet 5 inches (3.40 m × 1.35 m)
  • {{cvt|3.40|x|1.35|m|ftin|order=flip}} → 11 ft 2 in × 4 ft 5 in (3.40 m × 1.35 m)
Johnuniq (talk) 23:00, 29 September 2024 (UTC)[reply]
OK, Thank you --Redrose64 🌹 (talk) 17:10, 30 September 2024 (UTC)[reply]

A new double conversion

[edit]

For Reciprocating engine#History {{convert|2,300|metric ton|short ton long ton|lk=on}} and {{convert|2,300|metric ton|ST LT|lk=on}} 2,300 metric tons ([convert: unknown unit]) and 2,300 metric tons (2,535 short tons; 2,264 long tons) instead of {{convert|2,300|metric ton|short ton|lk=on}} or {{convert|2,300|metric ton|long ton|lk=on|sigfig=4}} 2,300 metric tons (2,535 short tons) or 2,300 metric tons (2,264 long tons) Peter Horn User talk 01:54, 6 October 2024 (UTC)[reply]

@Peter Horn: When a unit code such as short ton contains a space, use + to separate units:
Johnuniq (talk) 02:09, 6 October 2024 (UTC) Peter Horn User talk 02:41, 6 October 2024 (UTC)[reply]
Thanks. Peter Horn User talk 02:49, 6 October 2024 (UTC)[reply]