Template talk:Convert/Archive April 2009

Negative distance values/minus sign formatting
This problem probably hasn't been encountered very often, but I've discovered that when dealing with negative distance values (in my case, using metres-to-feet conversion), the outputted conversion (feet value) is correctly formatted with an en-dash as the minus sign, while the original value (metres value) is returned with a hyphen as minus sign. I tried using the en-dash as input value, but obviously that throws the template code.

You might wonder why I'd be dealing with negative distances -- my case in point is the article Voronya Cave, currently the deepest cave in the world, in which location depths are marked as negative-number values in metres and/or feet. So for example, I would use -1200 m, which currently returns -1,200 m (–3,937 ft). Is there a reasonably quick fix in the code to make the template return an en-dash for both values? Thanks, Fattonyni (talk) 23:19, 2 April 2009 (UTC)
 * It's not an en-dash but a minus sign (they look different on some browsers –−–−–−–−–−). This really deserves something better than a quick fix but until there's time I'll work on one. J IM ptalk·cont 07:33, 3 April 2009 (UTC)

Here is the new code for Convert/LoffAonDbSoff.

&amp;nbsp;

J IM ptalk·cont 10:10, 3 April 2009 (UTC)


 * ✅&mdash;  MJC detroit  (yak) 04:20, 4 April 2009 (UTC)


 * Cool, thanks for sorting that. I see the experimental "or" parameter still shows a hyphen instead of a minus sign though; can a similar section of code be added to this? e.g. " -1508 m " shows "-1,508 m or −4,948 ft". Fattonyni (talk) 09:09, 4 April 2009 (UTC)


 * Update: Also when using the range function the same problem occurs. Fattonyni (talk) 09:18, 4 April 2009 (UTC)

It's going to take similar edits to a number of templates to get this solution working properly everywhere but this particular quick-fix is not really the best way to go. J IM ptalk·cont 09:48, 4 April 2009 (UTC)

This code should be added to Convert/LoffAonDorSoff. J IM ptalk·cont 10:08, 4 April 2009 (UTC)

Rounding bug at Zero
It appears this template has a bug when converting Zero from metres to feet:
 * 0 m
 * gives
 * 0 m (1 ft 0 in)

--Ozhiker (talk) 11:15, 30 March 2009 (UTC)


 * I'll look into it. J IM ptalk·cont 12:33, 31 March 2009 (UTC)

Please edit Convert/m to the following.

J IM ptalk·cont 18:27, 6 April 2009 (UTC)
 * ✅ --CapitalR (talk) 21:39, 6 April 2009 (UTC)

Bug in range converts
I noticed this problem at Typhoon class submarine in the infobox where the class's displacements are displayed as a pair of ranges. 23200 - 24500 t and 33800 - 48000 t are the relevant templates. This appears to happen when the output number would be 1,000 or more (and thus would be formatted with a comma). Just thought I'd stop by and mention it. &mdash;/M endaliv /2¢/Δ's/ 14:21, 5 April 2009 (UTC)
 * fixedJ IM ptalk·cont 18:28, 6 April 2009 (UTC)

should work, but doesn't
39896 km/h doesn't seem to work: 39896 km/h  Maybe I'm missing something. jhf (talk) 20:21, 15 April 2009 (UTC)
 * Well, its either m/s or mph, you've got both. GregorB (talk) 21:03, 15 April 2009 (UTC)
 * I don't understand how this differs from the multiple-conversion example given in the documentation: 641 acre, which works: 641 acre. The units and the switches are different, is all. 641 acre works too, so it doesn't seem to be the switches.  jhf (talk) 22:09, 15 April 2009 (UTC)
 * Each "convert to" pair must be specifically created. Just because "km2 sqmi" works, doesn't mean that "m/s mph" must work as well. Everything isn't dynamically created, it must be hard-coded beforehand. — Huntster (t • @ • c) 22:43, 15 April 2009 (UTC)
 * Okay, I see the "combinations" column in the doc now. Thank you.  jhf (talk) 23:03, 15 April 2009 (UTC)

Add "or" to range
Can "or" be added to range values, to work similarly to "to"? Gaius Cornelius (talk) 06:57, 20 April 2009 (UTC)

bot to hard code convert template results
Moved. See Village pump (technical)). —EncMstr (talk) 05:32, 24 April 2009 (UTC)