Template talk:Convert/Archive December 2012

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

Default rounding not quite right for temperature differences?

{{convert|0.1|C-change}}

GIves

0.1 °C (0.18 °F)

Looks incorrectly overprecise. --Paul_012 (talk) 09:11, 2 December 2012 (UTC)

Try

{{convert|0.1|C-change|sigfig=2}}

Gives

0.1 °C (0.18 °F)

FrankFlanagan (talk) 21:29, 2 December 2012 (UTC) 07:41, 3 December 2012 (UTC)

Still over-precise, unless you mean 0.10±0.005°C rather than 0.10±0.05°C. Martinvl (talk) 08:22, 3 December 2012 (UTC)

Choose the precision you want. Using |sigfig you get to choose the number of digits starting from the left. Using |1 you get to choose the number of digits after the decimal point.
{{convert|0.1|C-change|sigfig=1}} gives 0.1 °C (0.2 °F)
{{convert|0.1|C-change|1}} gives 0.1 °C (0.2 °F)
{{convert|15.1|C-change|sigfig=1}} gives 15.1 °C (30 °F)
{{convert|15.1|C-change|1}} gives 15.1 °C (27.2 °F)
Both give the same result in the example but differ for bigger numbers.  Stepho  talk 
the root of the problem appears to be with {{convert/roundT0}}. in particular {{convert/roundT0|0.1|0.1|||0.1*1.8}} is saying round (0.1*1.8) to the same level of precision as 0.1, but instead there is a "max/2" in there that is bumping up the precision. Frietjes (talk) 18:27, 3 December 2012 (UTC)

I've tweaked it a little so it gives 0.18 °F instead of 0.180 °F, which, yes, is still overly precise but is in keeping with the regular default rounding rule of giving at least two significant figures mentioned on the doc. JIMp talk·cont 14:28, 4 December 2012 (UTC)

Errors at the moment

Just in case anyone comes to complain about all the red errors, it is not a problem with this template, but something in the backend MediaWiki software. hopefully it will be fixed soon, but

{{#expr:3.0/0.2}} is currently resolving as Expression error: Division by zero

which is clearly wrong. The same does not happen with {{#expr:3.0*((0.2)^(-1))}} though, for some reason. Frietjes (talk) 00:10, 7 December 2012 (UTC)

Thank you - I was about to make a note about this messing up an article I'm editing. Cheers, Baffle gab1978 (talk) 00:18, 7 December 2012 (UTC)
Good to know I'm not seeing things. –Fredddie 00:24, 7 December 2012 (UTC)
see Recent changes to MediaWiki (related threads). 198.102.153.2 (talk) 00:33, 7 December 2012 (UTC)
now fixed. 198.102.153.2 (talk) 01:23, 7 December 2012 (UTC)

Broken plurals for multiple less-than-one decimal values (2)

Previously requested and fixed at Template talk:Convert/Archive October 2012#Broken plurals for multiple less-than-one decimal values. Using "to" as a parameter now gives the correct result, but

{{convert|0.1|and|0.2|m}}; {{convert|0.1|-|0.2|m}}

still gives:

0.1 and 0.2 metres (3.9 in and 7.9 in); 0.1–0.2 metres (3.9 in – 7.9 in)

It should be metres. Could the same fix be applied to these two cases as well please? --101.109.217.201 (talk) 22:21, 7 December 2012 (UTC)

I will have a look ... Plastikspork ―Œ(talk) 04:50, 8 December 2012 (UTC)
I updated the code for Template:Convert/and/AoffSoff, since it looks like it is the same as Template:Convert/to/AoffSoff, but with "and" instead of "to". The code for Template:Convert/-/AoffSoff is a bit difference since there is checks for negative numbers for padding. I don't have time to debug it right now, but I will if need be. Thanks! Plastikspork ―Œ(talk) 05:05, 8 December 2012 (UTC)

disp=flip and disp=5

At the moment we can not combine the options for |disp=flip and |disp=5 . Can anybody think of a way to allow these two options to be used together? Thanks.  Stepho  talk  02:14, 19 December 2012 (UTC)

disp=flip5.Jason Rees (talk) 02:28, 19 December 2012 (UTC)
That works beautifully. Did that already exist or did you add it especially for me? Thanks.  Stepho  talk  01:22, 21 December 2012 (UTC)
While i would love to take the credit for creating it especially for you, it already existed as it was a feature that was added ages ago.Jason Rees (talk) 05:31, 21 December 2012 (UTC)

Million

I thought using words like million was default for this template. Why isnt it so? Surely converting 1.2 million sq m to sq ft would be a lot simpler to display without all those extra zeroes!

TheOriginalSoni (talk) 21:41, 20 December 2012 (UTC)

you can use 1.2 million square metres (13 million square feet). the "million" has to be separated from the numeric part for the numeric part to be parsed. Frietjes (talk) 22:48, 20 December 2012 (UTC)

Potential conversion error: lbf to Newtons

Hi CONVERT template folks.

We are having a discussion over on an article Talk page. It appears that the convert template may be doing something incorrectly in converting pounds-force to Newtons. E.g., 1.1 million lbf is showing up as [convert: unit mismatch] (1,100,000 lbf); or 9500 kN. But several editors say that is not correct, and that the more correct answer of kN seems to be about half that.

Would one of you who knows how this template works perhaps be willing to look in on that conversation? Thanks. N2e (talk) 04:52, 25 December 2012 (UTC)

The unit kn is knot (speed) and {{convert}} has no method to check for incorrect units. Use kN for kilonewtons:
{{convert|1100000|lbf|kN}} → 1,100,000 pounds-force (4,900 kN)
Johnuniq (talk) 07:34, 25 December 2012 (UTC)
Thank you very much Johnuniq! My error in the use of the convert template. Will use kN from here forward. N2e (talk) 12:24, 25 December 2012 (UTC)

Display output problem

Hi. When I use {{convert|1100000|lbf|kN|abbr=on|disp=output only}}, it works, like this: 4,900 kN.

However, when I use {{convert|1100000|lbf|kN|abbr=on|disp=output number only}}, which should work according to the description in Wikipedia:CONVERT#Parameters, it breaks, like this: 4,900.

I'm probably doing something wrong. Would appreciate help from a template guru, because as it stands, I'm leaving units in a table where none of the other table entries list their units (@Falcon (rocket family). Cheers. N2e (talk) 12:57, 25 December 2012 (UTC)

Remove |abbr=on: {{convert|1100000|lbf|kN|disp=output number only}} → 4,900
Trappist the monk (talk) 13:16, 25 December 2012 (UTC)
Thanks, Trappist. That works great. N2e (talk) 08:42, 26 December 2012 (UTC)

abbr=on

In Psilocybe quebecensis#Habitat and formation, 6 to 15 °C (42.8 to 59.0 °F) "abbr=on" does not work, but 6 to 15 °C (42.8 to 59.0 °F) does. Peter Horn User talk 00:38, 27 December 2012 (UTC)

fixed. Frietjes (talk) 16:54, 31 December 2012 (UTC)

pdr and adj=on

This sentence fragment is from USS Philadelphia:

... and mounted three cannons, one 12-pounder (5.4 kg) facing forward and two 9 pounders (4.1 kg) facing port and starboard respectively.

The sentence has two {{convert}} templates in it. The first has |adj=on: {{convert|12|pdr|adj=on}} while the second does not:{{convert|9|pdr}}. I'm wondering if the rendered output of {{convert}} is grammatically correct. Shouldn't the output always have a hyphen between the number and pounder or pounders?

MOS:HYPHEN seems to suggest that numbers and their units are to be hyphenated when the unit is spelled-out. No mention is made of singular or plural. In this case, both units are to be spelled-out, one is singular and one is plural. I submit that the both should be hyphenated.

Trappist the monk (talk) 00:40, 27 December 2012 (UTC)

Yes, there should always be a hyphen between the number and pounder. But I question the usefulness of converting those numbers to kilograms. Would the conversions be at all useful to someone not familiar with pounds? As far as I know, guns have never been classified by the weight of their shot in kilograms. Indefatigable (talk) 19:51, 27 December 2012 (UTC)
Aye, you're probably right that canon wasn't classified by kilograms. But then, loaders, gun captains, and all others who dealt with the canon and their ability to inflict damage upon another vessel didn't spend any time reading Wikipedia. So, yes, I think that the conversions are useful because, for those who live in countries with reasonable systems of weights and measures, pounds are a pretty much meaningless quantity; converting the number to kg at least gives them some idea of how heavy the shot was.
Trappist the monk (talk) 00:54, 28 December 2012 (UTC)