Jump to content

Template talk:Convert/Archive February 2008

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Plural abbreviations?

[edit]

I notice that 8 pounds is abbreviated to 8 lbs not 8 lb. Is there a reason for this? Can it be changed (please)?

Ewen (talk) 12:20, 31 January 2008 (UTC)[reply]

I don't see where you are seeing this. In the actual code it is written as |u=lb (for convert/lb) and |o=lb (for convert/kg). Therefore it can only be lb.

{{convert|8|lb|abbr=on}} --> 8 lb (3.6 kg)
{{convert|8|kg|abbr=on}} -->8 kg (18 lb)

MJCdetroit (yak) 13:53, 31 January 2008 (UTC)[reply]
I think Ewen means this sort of thing - 10 st 8 lb (67 kg) {{convert|10|st|8|lb|kg|abbr=on}} when converting from stone/pounds to metric. Florrieleave a note 14:01, 31 January 2008 (UTC)[reply]
That's the fella! Sorry it wasn't clear. Any ideas? Ewen (talk) 14:04, 31 January 2008 (UTC)[reply]
Yeap, I found the error in Template:Convert/and/lb and fixed it. Thanks Florrie. —MJCdetroit (yak) 16:36, 31 January 2008 (UTC)[reply]
Looks like the results of someone's coming along, with good intentions I'm sure, and "fixing" the template before reading WP:UNITS. Jɪmp 05:55, 1 February 2008 (UTC)[reply]

Rounding causing template error

[edit]

In the WWII article, {{convert|600|mi|km|−2}} is presently coming up with "600 miles (Expression error: Unrecognised punctuation character "�" km)". I expect there are other places this is showing up. Can somebody take a look please? If there is a better attention getter than {{editprotected}}, please change. --J Clear (talk) 22:47, 1 February 2008 (UTC)[reply]

The error is in the template calls: for negative input numbers use a hyphen as the minus sign.--Patrick (talk) 00:57, 2 February 2008 (UTC)[reply]
Since I only noticed the error on WWII (since corrected by User:Bigbluefish), I'm curious as to what the offending character is and how it got in the article, visually I see no difference. Since the obvious keys on the PC keyboard generates the correct character, at least on my US PC keyboard, it seems like someone went an extra step to get it wrong. Not to mention not previewing their changes on a protected page. After a bit of detective work, it looks like a "figure dash", UTF-8 E2 80 92. I wonder what combination of keyboard or key bindings does that. Maybe I'll track down the "offending" editor and let them know. --J Clear (talk) 16:01, 2 February 2008 (UTC)[reply]

Feet and inches not precisely converted

[edit]

6 feet 4 inches (1.93 m) ({{convert|6|ft|4|in|m|sigfig=3}}) is correct but 6 feet 4 inches (1.93 m) ({{convert|6|ft|4|in|m}}) is assumed. As 1 inch is 2.54 cm then rounding to the nearest 10 cm seems wrong...

Ewen (talk) 14:26, 2 February 2008 (UTC)[reply]

Try it like this:
ft 11 in (1.80 m)
{{convert|5|ft|11|in|2|abbr=on|lk=on}}
ftin (1.93 m)
{{convert|6|ft|4|in|2|abbr=on|lk=on}}
You just need the 2 for decimal places. Florrieleave a note 14:35, 2 February 2008 (UTC)[reply]
That's neater, thanks Florrie. I still contend that the default for ft & in to metres should be 2 dp not 1. Ewen (talk) 15:26, 2 February 2008 (UTC)[reply]
The number of decimals (compared with those of inches) is increased by 1, because the factor 0.0254 is between 0.02 and 0.2, see above. A range from 0.03 to 0.3 could also be defended, with the geometric mean closer to 0.1, in which case we would get the extra decimal, being in the range from 0.003 to 0.03.--Patrick (talk) 15:36, 2 February 2008 (UTC)[reply]
Yes, 0.003 to 0.03 ... i.e. 3 × 10n + 1 to 3 × 10n for interger n generally would be defensible. On the other hand, strictly speaking, to avoid any false precision, we should use 1 × 10n + 1 to 1 × 10n. For example, strictly speaking, since inches are bigger than centimetres, you should round to decimetres. Similarly, nautical miles should go to 10 km and even metres to 10 yd. However, we're generally not as strict as that when we do conversions so I made some allowance for increased precision. The line had to be drawn somewhere, though, and I chose 2 ... or if you're a stickler for precision, I chose 100.3010299957. So metres go to yards, nautical miles to kilometres, etc. but 2.54 is just out of range so inches still go to decimetres but I'm not saying that that 2 is set in stone or anything. Jɪmp 02:54, 4 February 2008 (UTC)[reply]
I suppose you mean "to avoid any false precision, we should use 1 × 10n - 1 to 1 × 10n". Note however, with any such rule, if a result is e.g. 534 we cannot be sure that the true value is between 533.5 and 534.5, because if the given number multiplied by the conversion factor is 533.5, the actual value may be less.--Patrick (talk) 09:53, 4 February 2008 (UTC)[reply]

Conversion imprecision

[edit]

At Tyrone Wheatley something seems to be wrong with {{convert}}. What might it be?--TonyTheTiger (t/c/bio/WP:CHICAGO/WP:LOTD) 21:34, 2 February 2008 (UTC)[reply]

I didn't see a problem. Could you provide more details? —MJCdetroit (yak) 15:00, 3 February 2008 (UTC)[reply]
It seems to be fixed now. It had been converting 235 lbs to 107 kg, 233 lbs to 106 and 230 to 100, with the latter being out of whack.--TonyTheTiger (t/c/bio/WP:CHICAGO/WP:LOTD) 20:20, 3 February 2008 (UTC)[reply]
It was fixed by PrimeHunter. The template reads 230 as 230 ± 5 thus will round 230 lb to the nearest 10 kg. This can be over-ridden by setting the precision and/or number of sig figs. Jɪmp 03:20, 4 February 2008 (UTC)[reply]

Fails on zero values (km→mi)

[edit]

The Convert macro appears to fail on zero values;

  • {{convert|0|km|mi}}→0 kilometres (0 mi)

with the converted result "(Expression error: Unexpected < operator mi)". —Sladen (talk) 13:18, 4 February 2008 (UTC)[reply]

The default rounding relies on determination of the order of magnitude of the converted value. 0 × 1000 ÷ 1609.344 has an infinitely small order of magnitude. Thus {{ordomag}} is giving an error message. The error message is passed on to {{max/2}} which produces another error message which in turn is passed on to {{rnd}} to give the message you see. If ... for some reason I really can't imagine ... you want to convert 0 sometings to 0 something elses (don't worry temperatures are safe) you can avoid all this by specifying the number of decimal places you want (don't bother with sigfig, it'll give you the same problem).
  • {{convert|0|km|mi|0}}→0 kilometres (0 mi)
Jɪmp 16:28, 4 February 2008 (UTC)[reply]
Thanks for the answer, AFAICT, the returned order of magnitude should be 0 (zero), just as with the other single-digit integer values in the range -9..+9.
I just had a quick look and trying to follow through; is the call sequence "Ordomag"→"Ordomag/+"→"Ordomag" recursively? Use cases are very easy to find; tables of numbers, route/distances maps—any instance where the data has come from an external source and consistent, reliable presentation is required.
The easiest fix I think would be to adjust to the initial if statement x<0 ? ordo(x) : ordo(-x) to be x<0 ? ordo(x) : (x>0 ? ordo(-x) : 0) or some variation on that. Or to check if altering a comparision from '<'→'<=' could be made at a lower level? —Sladen (talk) 19:30, 4 February 2008 (UTC)[reply]
I made a change [1] to fix it.--Patrick (talk) 01:14, 5 February 2008 (UTC)[reply]

Convert template needed

[edit]

The template will not convert miles and chains to km at the moment. Can this be sorted? A chain is 22 yards, btw (80 chains=1mile). It would look somethin like {{convert|2|mi|chain|km}} and give an answer something like - 2 miles, 17 chains (3.56 kilometres). —Preceding unsigned comment added by Mjroots (talkcontribs) 22:00, 4 February 2008

It would look more like {{convert|2|mi|17|chain|km}} (you forgot the 17) and would give an answer more like 2 miles 17 chains (3.6 km) (the default would be to round chains up to the nearest hectometre). But are chains all that common these days? Jɪmp 23:40, 4 February 2008 (UTC)[reply]
No, they're not that common, except for measuring distances on railways in the UK. See this discussion (or rather, heated argument) for the background to this. It would greatly help if that functionality could be added to this template (if only to keep certain editors quiet). --RFBailey (talk) 02:03, 5 February 2008 (UTC)[reply]
Currently {{convert|2|mi|17|chain|km}} gives 2 miles (3.2186880000000 km) Mjroots (talk) 08:29, 5 February 2008 (UTC)[reply]
It's not functional yet and thus is converting 2 miles to kilometres with a precision of 17 decimal places. Jɪmp 17:19, 5 February 2008 (UTC)[reply]
Is it likely to be functional any time soon? --RFBailey (talk) 01:23, 7 February 2008 (UTC)[reply]
As soon as one of the admins replaces {{convert/mi}}'s current code with the following.
{{convert/{{#ifeq:{{{4}}}|chain|and/chain|{{{d}}}}}|{{{1}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|s={{{s|}}}|r={{{r}}}|d={{{d}}}
|u=mi
|n=mile
|o=km
|b=1609.344
|j=3.206648885-{{{j|0}}}}}<noinclude>{{pp-template}}
[[Category:Subtemplates of Template Convert]]
</noinclude>
Though it might need debugging & won't do slashes or tables yet. Jɪmp 05:45, 7 February 2008 (UTC)[reply]
{{convert|2|mi|17|chain|km}}--->2 miles 17 chains (3.6 km)
Done and I've temporarily changed the protection level to allow debugging. —MJCdetroit (yak) 13:02, 7 February 2008 (UTC)[reply]
That's great--thanks! --RFBailey (talk) 13:38, 7 February 2008 (UTC)[reply]

horsepower conversions

[edit]

Just noticed that PS metric horsepower is included in template, is it possible to add third unit to conversion, like kW> PS and bhp (what is used in GB) as results? --— Typ932T | C  23:29, 6 February 2008 (UTC)[reply]

Sure, do you want PS and bhp or just PS and hp ... or both? Jɪmp 00:08, 7 February 2008 (UTC)[reply]
Well Im not sure what combinations should be, maybe both, bhp is missing from auto templates, what about torque: kgm to Nm and ftlbf? --— Typ932T | C  00:18, 7 February 2008 (UTC)[reply]
bhp would maybe good to get as kW and PS, there is so many combinations PS,hp,bhp,kw that all cant be included comes too long results? --— Typ932T | C  00:46, 7 February 2008 (UTC)[reply]
To the best of my knowledge the difference between bhp and hp is simply a matter of where you're doing the measurement with the former being specific and the latter general. Thus, they are not different units. This was the assumption made when bhp was added to the template. Therefore you wouldn't have a combination which included both hp and bhp. Indeed, the following might suffice.
  • kW PS
  • kW hp
    • kW bhp
  • PS hp
    • PS bhp
With respect to torque, yes, a Nm ftlbf combination would be useful for conversions from kgf·m. I wonder whether kilogram-force-metres are common enough to warrant Nm kgfm and kgfm ftlbf. Jɪmp 05:40, 7 February 2008 (UTC)[reply]
I think only kgm to Nm ftlbf is enough, no need to get kgm --— Typ932T | C  08:20, 7 February 2008 (UTC)[reply]
Done. Jɪmp 00:24, 8 February 2008 (UTC)[reply]
Tested It gives 110 kW 150 bhp and 150 PS should be like something like 147 bhp? --— Typ932T | C  00:42, 8 February 2008 (UTC)[reply]
I see with rounding 1 it gives 110 kW (149.6 PS/147.5 bhp) --— Typ932T | C  00:53, 8 February 2008 (UTC)[reply]
It's reading the 110 kW as 110 ± 5 kW and rounding accordingly. Yes, if you want greater (or less) precision specify it (as you have). Setting precision to 0 gives "110 kilowatts (150 PS; 148 bhp)". Note, you can also specify the number of significant figures by using |sigfig=. Jɪmp 02:55, 8 February 2008 (UTC)[reply]

I´ve inserted quite a few automotive power templates in the course of the last weeks, and have adhered to a (so to say) case-sensitive practice; i.e. when giving figures for Euro cars I am using a PS-hp-kW or a kW-PS-hp template; if dealing with specific US versions of Euro cars I am using a hp-PS-kW template. Strictly speaking, a kW-PS-hp template should be used for Euro cars built after about 1990 or so, when the Brussels bureaucrats dictated the exclusive use of kW instead of PS. For all practical purposes, I´m treating bhp and hp as identical - what really counts is the difference between DIN PS, (net) hp (PS/1.014) and DIN kW (PS/1.36). --- I´m all for using these templates for the sake of uniformity and to avoid someone changing a single figure without changing an accompanying figure. There are some issues about rounding when using a kW-based template, like 85 kW = 116 PS, when the works actually gave a figure of 115 PS; but that´s negligible and a common sight in all source books, like my beloved Automobil Revue annual catalogs. --- There seems to be a problem with the km/h-mph template; 250 km/h regularly translates to 160 (instead of 155) mph - anyone know a fix for that? --328cia (talk) 18:48, 21 March 2008 (UTC)[reply]

miles+yards→km

[edit]

Just tried to do {{convert|1|mi|176|yd|km}} on Solway Junction Railway, which doesn't work at present. The yards were a multiple of 22, so I switched it to miles:chains for the moment. —Sladen (talk) 21:25, 11 February 2008 (UTC)[reply]

No, miles & yards don't work as yet. Jɪmp 00:01, 12 February 2008 (UTC)[reply]

m → ft and in?

[edit]

Any chance of getting the template to convert metres to feet and inches rather than just a decimal figure in feet? — Cheers, JackLee talk 14:43, 12 February 2008 (UTC)[reply]

Like this?:

{{convert|10|m|ftin|}}-->10 metres (32 ft 10 in) (BTW:in decimal it would be 32.8 ft)

because it already exists. —MJCdetroit (yak) 15:24, 12 February 2008 (UTC)[reply]

Oh, fantastic. I had tried "{{convert|10|m|ft in}}" but that didn't work. Is what you mentioned stated in the usage notes? I didn't see anything about it in them. — Cheers, JackLee talk 15:54, 12 February 2008 (UTC)[reply]

I just added it to the "short list" which shows up on the template doc page. However, I could not figure out how to add it to the "full list". Jimp will have to do that at some point. —MJCdetroit (yak) 16:52, 12 February 2008 (UTC)[reply]

Much appreciated. — Cheers, JackLee talk 17:51, 12 February 2008 (UTC)[reply]

Support for ranges?

[edit]

Are ranges supported in this template? I'd like the text to read "1 to 2 miles (1.6 to 3.2 km)". I find this to be much more readable than "1 mile (1.6 km) to 2 miles (3.2 km)." How can I do this? Simishag (talk) 08:21, 13 February 2008 (UTC)[reply]

Not yet but I'll be working on it. Jɪmp 07:23, 14 February 2008 (UTC)[reply]
Cool! I'd offer to help but I'm not sure I understand the template system. I do have some suggestions for functionality:
  • A "range" should be just 2 values separated by a comma (or whatever). Anything with 3 values or more is not appropriate for this template, which might simplify things a bit.
  • There should be an option for the word to use for "to" above. "1 to 2 miles" is a common language construct in the English language. I think it's common in other languages but the word would vary and maybe the whole expression.
Anyway thanks, I'm looking forward to using this. Simishag (talk) 09:37, 14 February 2008 (UTC)[reply]
I generally recommend the use of a word (e.g. 'to') in unit ranges because a short line (hyphen, short dash, long dash) looks similar to a minus sign. Lightmouse (talk) 10:37, 14 February 2008 (UTC)[reply]

Another set of templates that duplicate the functions of this one

[edit]

There is another large set of templates that duplicate the functions of this one. Have a look at: [[Template:1ft3in]] and all the others in 'Category:Rail transport gauge templates'. Lightmouse (talk) 11:15, 14 February 2008 (UTC)[reply]

With the exception of the few that use fractions, most of those are redundant and over specialized. —MJCdetroit (yak) 17:17, 14 February 2008 (UTC)[reply]
I agree. They predate this template so the intention is understandable. I see no reason why they should not be replaced by this one. The only issue is to ensure that the format is correct. For example, I believe that metric rail gauges are usually expressed in mm with no commas. It is easy enough to check the rail templates to see what formats they use and simply adjust the convert template as required. Lightmouse (talk) 11:35, 15 February 2008 (UTC)[reply]

Smoot?

[edit]

Could the smoot length unit be included in this template? - Denimadept (talk) 18:47, 14 February 2008 (UTC)[reply]

You must be from Boston... —MJCdetroit (yak) 18:57, 14 February 2008 (UTC)[reply]
How'd you guess? - Denimadept (talk) 19:04, 14 February 2008 (UTC)[reply]
Of course. Jɪmp 03:42, 15 February 2008 (UTC)[reply]

Kilometres per second

[edit]

Can a template be provided for km/s? Lightmouse (talk) 14:39, 15 February 2008 (UTC)[reply]

Done. I've added mi/s too. Jɪmp 18:24, 18 February 2008 (UTC)[reply]

Why aren't there by default 2 decimals in meters?

[edit]

The default in meters should be {{convert|...|m|2}}. Anything else is (or at least should be) an exception. -62.219.97.68 (talk)

Why do you say that? Number of decimal places depends on the figures involved and their magnitude. Whoever uses the template should decide how many are appropriate. - Denimadept (talk) 18:40, 15 February 2008 (UTC)[reply]
The default is to round to a similar precision as the input. Jɪmp 18:27, 18 February 2008 (UTC)[reply]
Sorry to everyone, I forgot to mention I meant specifically to height. Re-read my statement now:
The default for US height (which is supposed to have no digits) should be {{convert|...|m|2}} (height in meters is supposed to have 2 digits)
But I guess you have no way to know if the editor wants height or something else, right? -62.219.107.102 (talk) 17:23, 19 February 2008 (UTC)[reply]
That's a strange one to me. As I understand it, the editor selects, as I said before and Jimp said as well, that it depends on the figures involved. Have you not taken science in high school or college? - Denimadept (talk) 17:36, 19 February 2008 (UTC)[reply]
I see no reason for you to break Wikipedia's rules by being unable to converse like a normal person. Anyway, if someone is X"Y', in meters they'd be Z.AB and vice versa.
For example, {{convert|5|ft|6|in|m}} is 5 feet 6 inches (1.68 m) when it really should be 5 feet 6 inches (1.68 m)
-62.219.107.102 (talk) 09:04, 20 February 2008 (UTC)[reply]
Not sure where that came from. If a figure is X ft, it's generally Y meters, depending on how many significant figures in X. Let's go into more detail to clear this up. If I have a figure 1234 ft, and do a conversion to meters, I'll get 376.1232 meters. In order to keep the four digits of precision I started with, I'll need to specify 1 decimal place. If I convert to centimeters, I'll get 37612.32 cm. In order to keep the proper digits of precision, I need to keep zero decimal places, and I'll still have more than I really should have. Understand? You only get to keep the number of digits of precision you started with. You can't expect a hard rule of "two decimal places for a meter" to make sense, so it's not in the template. You're expected to understand your figures, the number of digits of precision you started with, and how to get the template to display only the reasonable number of digits given your initial precision. If I'd started with a figure of 1234.0, I'd have 5 digits of precision, so I could display a total of 5 digits in my results. As I started with 4 digits, I only really can use 4 digits in the result. - Denimadept (talk) 14:31, 20 February 2008 (UTC)[reply]
Or, if you don't believe me, see Significant figures - Denimadept (talk) 15:36, 20 February 2008 (UTC)[reply]
The template is not designed specifically for people's heights but is a general purpose template. In many cases rounding to the nearest centimetre would be undesirable, conversions of mountain heights in feet, for example. Specification to the nearest centimetre involves a greater degree of precision than specification to the nearest inch. The default rounding does allow for some degree of increase in apparent precision but not this much. If you want two decimal places, you can specify this, but if you must have this as the template's default, there's always {{height}}. Jɪmp 01:58, 21 February 2008 (UTC)[reply]

Acres

[edit]

In the template output, input of "acre" is output only as the plural "acres." (No abbreviation is offered.) In some contexts (such as "1000-acre park") the output should be singular. The offer of the abbreviation "ac" would fix this -- can that be done? --Orlady (talk) 15:35, 17 February 2008 (UTC)[reply]

Use the adjective partameter e.g. {{convert|12|acre|ha|adj=on}} results in 12-acre (4.9 ha). TINYMARK 15:51, 17 February 2008 (UTC)[reply]
Thanks! That works. --Orlady (talk) 16:31, 17 February 2008 (UTC)[reply]

Decare

[edit]

Can someone add Decare to the area measures? It's commonly used in Norway, and possibly other European countries as well - corresponds to 1000 sqmeters. Thanks in advance. --Leifern (talk) 15:48, 18 February 2008 (UTC)[reply]

That is very similar the the metric Dunam, which we already have; {{convert|1.0|dunam|sqm sqft|0|lk=on}}--> 1.0 dunam (1,000 m2; 10,764 sq ft). It should be just a matter of duplicating the dunam sub templates and switching the names. —MJCdetroit (yak) 16:06, 18 February 2008 (UTC)[reply]
{{convert|1.0|decare|sqm sqft|0|lk=on}}--> 1.0 decare (1,000 m2; 10,764 sq ft)
{{convert|5.0|decare|4|lk=on}}--> 5.0 decares (0.0050 km2; 0.0019 sq mi)
Done. The default "convert to" is square kilometers and square miles. —MJCdetroit (yak) 16:25, 18 February 2008 (UTC)[reply]
Thanks! --Leifern (talk) 16:38, 18 February 2008 (UTC)[reply]
The code daa (the unit's standard abbr) can also be used. Jɪmp 18:24, 18 February 2008 (UTC)[reply]

Use of singular/plural

[edit]

Is there a way to select if units are described as singular or plural? I'd like the first sentence of Las Vegas Strip to say "a 4 mile (6.4 km) road". However, if I use {{convert|4|mi|km}}, I get "a 4 miles (6.4 km) road". Simishag (talk) 06:09, 19 February 2008 (UTC)[reply]

Use {{convert|4|mi|km|adj=on}}. Jɪmp 08:33, 19 February 2008 (UTC)[reply]

Messages

[edit]

I suggest include examples of conversion in the unit articles, specially when talking about the concrete unit conversion

For this, is better include customizable messages:

  • 1 psi is 6.894757 kPa: we could use {{convert|message|1|psi|is|kPa|6|abbr=on|lk=on}}.
  • 1 psi 6.894757 kPa: we could use {{convert|message|1|psi||kPa|6|abbr=on|lk=on}}.

If the parameter "message" or "mess" is employed, the user must include the message to show (in these cases is' or ). --Nopetro 08:14, 21 February 2008 (UTC)

If we're going to do this, it'll best be done with the existant disp parameter. Something like this.
  • 1 psi is 6.894757 kPa: we could use {{convert|1|psi|kPa|6|disp=mess/is|abbr=on|lk=on}}.
  • 1 psi 6.894757 kPa: we could use {{convert|1|psi|kPa|6|disp=mess/approx|abbr=on|lk=on}}.
or just
  • 1 psi is 6.894757 kPa: we could use {{convert|1|psi|kPa|6|disp=is|abbr=on|lk=on}}.
  • 1 psi 6.894757 kPa: we could use {{convert|1|psi|kPa|6|disp=approx|abbr=on|lk=on}}.
Jɪmp 08:45, 21 February 2008 (UTC)[reply]

Good. If you want, we can include disp= it in the template and in the documentation. Thank you --Nopetro 09:01, 21 February 2008 (UTC) —Preceding unsigned comment added by Nopetro (talkcontribs)

Don't thank me yet, it'll take a few dozen subtemplates to get the thing up & running. Jɪmp 03:07, 25 February 2008 (UTC)[reply]

Weight conversions

[edit]

There seems to be a problem with weight conversions:

{{convert|{{{weight_lbs|{{{weight_lb|200}}}}}}|lb|kg stlb|lk=on|abbr=on}} —> 200 lb (91 kg; 14 st 4 lb)

Which works here and on the sandbox, but it doesn't work here or when used in Template:Infobox Ice Hockey Player (see Theoren Fleury for an example). --JD554 (talk) 09:52, 21 February 2008 (UTC)[reply]

Just to add a bit more information: the problem only happens in Firefox not when using IE (not sure about other browsers). --JD554 (talk) 13:01, 21 February 2008 (UTC)[reply]
200 lb (91 kg; 14 st 4 lb)
200 lb (91 kg)
I changed the Template:Infobox Ice Hockey Player to just kg, so that should help. However, the main {{convert}} code hasn't changed since December 12th, 2007 and the sub template {{Convert/kg stlb}} hasn't been changed since January 12th. The subtemplate {{Convert/lb}} was placed under protection yesterday (Feb 21) but that doesn't change anything about the code itself. So the question remains: where is that extra space after the number and before the kg coming from? AND why only in FF? We'll try to figure it out. —MJCdetroit (yak) 15:01, 21 February 2008 (UTC)[reply]
It happens in IE7 (for WinXP)—MJCdetroit (yak) 16:12, 21 February 2008 (UTC)[reply]
I fixed it, somebody had added a newline to some templates, e.g. [2].--Patrick (talk) 17:52, 21 February 2008 (UTC)[reply]
The rnd templates shows: Expression error: Unrecognised punctuation character "{" are these used somewhere... --— Typ932T | C  18:04, 21 February 2008 (UTC)[reply]
That is the "result" in the case of undefined parameters. I have put includeonly tags now, to avoid the impression that something is wrong.

Request

[edit]

Could the verst and square verst please be added as a unit of length/area conversion option? The output should be both kilometers/square kilometers and miles/square miles. Thanks!—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 18:32, 21 February 2008 (UTC)[reply]

Done: codes are verst and sqverst (long-hand square verst also works). Jɪmp 03:31, 22 February 2008 (UTC)[reply]
Thanks, but could you make it convert to both kilometers and miles on the same call? {{Convert|100|verst|km}} produces "100 versts (110 km)", but "100 versts (110 km/66 mi) would be more helpful. Is that doable?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 14:50, 22 February 2008 (UTC)[reply]
Use km mi & km2 mi2 e.g. {{Convert|100|verst|km mi}} produces "100 versts (110 km; 66 mi)" and {{Convert|100|sqverst|km2 mi2}} produces "100 square versts (110 km2; 44 sq mi)" ... or, in this case, just leave it blank (it's the default for (sq)verst) i.e. {{Convert|100|verst}} produces "100 versts (110 km; 66 mi)" and {{Convert|100|sqverst}} produces "100 square versts (110 km2; 44 sq mi)". Jɪmp 16:53, 22 February 2008 (UTC)[reply]
P.S. just added verst2 for square verst. Jɪmp 17:03, 22 February 2008 (UTC)[reply]
Ah, must have missed that feature. Thanks again!—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); 18:06, 22 February 2008 (UTC)[reply]

Are you kidding?

[edit]

Judging by the code for this template, Mediawiki has created a language to rival Brainfuck for utter impenetrability. Kudos to the authors of this template for managing to stay sane and get it working. --Doradus (talk) 16:22, 22 February 2008 (UTC)[reply]

Temperature of 0.1 or -0.1 fails to convert

[edit]

{{convert | -0.1 | C | F | sigfig=1 }} produces

−0.1 °C (0 °F) which is incorrect. Nicholas Perkins (TC) 17:23, 24 February 2008 (UTC)[reply]

What is the correct answer, then? Seems a pretty straight-forward question at first glance but round 273.05 K to one sig-fig and you get 300 K, i.e. precision to the nearest hundred kelvins. Does it make sense then to say that -0.1 °C is precise to one significant figure ... what about the 273 K which are hidden from view? To me it really makes no sense to talk about significant figures in scales which don't start at zero. What the template is doing therefore is rounding the conversion to Fahrenheit to a degree of precision equivalent to that of the temperature in Kelvin rounded to one significant figure. No template error here, "I just wrote it like that". Of course, if we'd all be more happy pretending (I mean no offense) that −0.1 °C converted to Fahrenheit and rounded to one significant figure is 30 °F, things could be changed. However, I'd rather have the template return an error message and put a warning on the doc page not to try sigfig with Fahrenheit or Celcius. Jɪmp 03:02, 25 February 2008 (UTC)[reply]
Maybe he wanted "1", as in rounding precision of "1", and not "sigfig=1". In other words,
{{convert|-0.1|C|F|1 }} --> −0.1 °C (31.8 °F)
Just a thought, but a small warning on the doc page about this sigfig °C/°F maybe warranted. —MJCdetroit (yak) 03:13, 25 February 2008 (UTC)[reply]
Done.--Patrick (talk) 10:25, 25 February 2008 (UTC)[reply]
That's exactly what I was after. Thanks for the help and sorry for the inconvenience. Nicholas Perkins (TC) 09:50, 25 February 2008 (UTC)[reply]

Code deprecation

[edit]

I've depreciated kph in favour of km/h, try it now and you'll get "The code kph is depreciated. Use km/h instead.". In time the subtemplate should be deleted. I'd like to do the same with a few others but some are still quite widely used e.g. km:h. One, however, does stick out in particular. kt is currently an alternative abbreviation for knots, however, in standard metric abbreviation "kt" stands for "kilotonne". I keep changing the transclusions using it to kn but they keep on coming. It's getting time to kill this one off. Jɪmp 01:46, 27 February 2008 (UTC)[reply]

I'm about to put similar messages on {{convert/m:s}} and {{convert/ft:s}}. I've also put the following up for deletion.
Jɪmp 06:39, 27 February 2008 (UTC)[reply]
Excellent! Incidentally, The SI authority acknowledges the absence of a standard unit for knot but it uses 'kn'. See: Table 8. Other non-SI units.
I am delighted that you are now deprecating these templates. I have corrected many of the unwanted formats (kph, kmph, km/hr, kt, kts, km:h, mi:h, etc). My script does this automatically if it comes across them. If anyone wants the script or AWB regex for such things, just let me know. Some of these are ideal bot fodder. Lightmouse (talk) 10:37, 28 February 2008 (UTC)[reply]
I've put
up for deletion. Jɪmp 23:50, 3 March 2008 (UTC)[reply]

Square brackets for quotes?

[edit]

What do people think about an option for square brackets for use in quotes? This appears to be a convention. Lightmouse (talk) 10:43, 28 February 2008 (UTC)[reply]

It wouldn't be hard to do ... laborious, but not hard. What code will we use unlike disp=/ for slashes we can't use actual square brackects it won't work. How about disp=sqbr? Jɪmp 23:57, 28 February 2008 (UTC)[reply]

What about documentation

[edit]
moved from Template talk:Convert/km/h mph

Of this template ?. About how to use it. --Mac (talk) 08:18, 5 February 2008 (UTC)[reply]

{{Convert/km/h mph|1}}

It's but a small part of {{convert}}. It's normally used like this {{convert|10|kn|km/h mph}} which gives 10 knots (19 km/h; 12 mph). Jɪmp 17:14, 5 February 2008 (UTC)[reply]