Template talk:Convert/Archive April 2009
{{talkarchive}}
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
: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. JIMp talk·cont 07:33, 3 April 2009 (UTC)
Here is the new code for {{tl|Convert/LoffAonDbSoff}}.
{{convert/numdisp|{{{1}}}}} {{{u}}} ({{convert/{{#if:{{{2|}}}|{{{o}}}|{{{3}}}}}|{{{1}}}|{{{1}}}*{{{b}}}|{{#if:{{{2|}}}|{{{3|}}}|{{{4|}}}}}|{{{s|}}}|r={{{r}}}|j={{{j}}}|d=LoffAonSoff}})
Category:Subtemplates of Template Convert {{pp-template|small=yes}}
JIMp talk·cont 10:10, 3 April 2009 (UTC)
:{{done}}—MJCdetroit (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. "
::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. JIMp talk·cont 09:48, 4 April 2009 (UTC)
This code should be added to {{tl|Convert/LoffAonDorSoff}}. JIMp talk·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:
:
: gives
: 0 m (1 ft 0 in)
--Ozhiker (talk) 11:15, 30 March 2009 (UTC)
::I'll look into it. JIMp talk·cont 12:33, 31 March 2009 (UTC)
{{t1|edit protected}}
Please edit {{tl|Convert/m}} to the following.
{{convert/{{{d}}}|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|s={{{s|}}}|r={{{r}}}
|u=m
|n=met{{{r}}}
|t=metre
|o=ft{{#ifexpr:{{{1|4}}}>0 and {{{1|4}}}<3|in}}
|b=1
|j=0-{{{j|0}}}}}
{{pp-template|small=yes}}
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.
should work, but doesn't
: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:
:::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 Wikipedia:Village pump (technical)#bot to hard code convert template results). —EncMstr (talk) 05:32, 24 April 2009 (UTC)