Jump to content

Template talk:Convert/Archive March 2008

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

Wondering about cases

[edit]

Would it be easy and acceptable to add a "cases" to "liters" routine into the mix? Just wondering, certainly no grave matter but would help a dilemma with wine and winery-related articles. I have no experience with this, but it seems it should be staightforward to plug a digit for "cases" then convert x12 x 0.75 for a liter value.. and eh.. the opposite..? Is this a possibility? MURGH disc. 21:16, 18 February 2008 (UTC)[reply]

I am sure it is possible. However, initially, I'd have to say that we shouldn't because the definition varies by location. I thought that you were talking about beer until I read the second line. In my part of the world, a "case" almost always refers to beer; one case = 24 x 12 US fl oz. Also, in the wine world, is that a case of fifths (750 mL) or magnums (bigger but not sure how much, don't do much wine drinking)? Also, most wine bottles that I remember seeing are labeled in milliliters (mL) not liters (L). —MJCdetroit (yak) 21:34, 18 February 2008 (UTC)[reply]
Yes you're right, 750 mL is a common bottle declaration, but when winery is defined in annual activity by 550,000 bottles or 80,000 cases, being able to relate it in terms of hectolitres or gallons could have some encyclopedic value. But yes, the initial "case" in question here is a very French affair, but couldn't this be specified? MURGH disc. 21:54, 18 February 2008 (UTC)[reply]
It could be done. One case would be 12 × 750 ml, i.e. 0.009 m³. It wouldn't work for American beer nor would it work for Canadian or Japanese beer but it would work for Australian beer since Aussie beer cans are bigger (375 ml, still two dozen a case). Jɪmp 00:29, 19 February 2008 (UTC)[reply]
I'm pretty sure the "wine case" and 750 mL wine bottle standards are consistent with the continental Europe, US, South American, Australian and South African wine industries/markets. Liters and gallons on the other hand. so.. 0.009 m3 (0.090 hl), so a wine case is 9 liters, 9 L (2.4 US gal).. cool. (unless I screwed up the math?) Yes, this would be a nice function for winery infoboxes and such. How do I most wisely petition for this? MURGH disc. 03:10, 19 February 2008 (UTC)[reply]
I've edited the above post the swap cum for m3. JIMp talk·cont 00:39, 1 July 2008 (UTC)[reply]
Just so there isn't any confusion, I think that we shouldn't use "case" by itself. It should be "winecase" (or something).
On a side note to Jimp: in the U.S. a case of beer is 24 x 12 US fl oz (355 mL), both cans and bottles. However, in Canada (at least in Ontario and Quebec), they're not referred to as "a cases of beer", they're referred to as a "Two-Fours of beer" in which cans are sized in U.S. fl oz: 12 fl oz (355 mL) and bottles are sized in imperial fluid ounces: 12 imp fl oz (341 mL). So you can see why we shouldn't use "case" by itself. [1]. —MJCdetroit (yak) 04:26, 19 February 2008 (UTC)[reply]
You most wisely petition the way you are. I don't recall hearing two-four of beer when I was in Canada but I was on the other side ... and mostly bought six-packs. Is it 12 fl oz (355 ml) or is it 355 ml (12 fl oz) in the US ... i.e. what's the definition. I believe it's plain 355 ml for a can in Canada without mention of US fl oz (except on imports). No, just case by itself may lead to strife ... at least in the coding but would not context (and the conversion) dispell the ambiguity when it comes to what the template displays? That is if we're talking about US beer then we shouldn't need the likes of case (US beer) displayed in the article ... or am I stating the obvious. Jɪmp 08:45, 19 February 2008 (UTC)[reply]
But how does the US (or Canadian) beer industry measure volume performance by year? Is case such a widely used term (I've never gone beyond "a couple of six-packs". I've heard of "crates of beer"..) For Euro wine, it's a constant annual production term for wineries (except those offering bottle numbers which one can of course divide by 12), and then regions will declare estimations of hL. It would be great to have a tool that could translate figures between these. MURGH disc. 12:32, 21 February 2008 (UTC)[reply]
The hectolitre may well be used by specialists but it is by no means universal in the industry. We should remember that an encyclopedia for all (i.e. Wikipedia) can be informed by, but is not bound by what specialists do. However I have no objection to the conversion option being available. Lightmouse (talk) 21:44, 21 February 2008 (UTC)[reply]
Of course, the template already does hectolitres should the need arise for such a unit. I'm adding winecase defined as nine litres. Other cases can be added later if needed. Jɪmp 14:37, 27 February 2008 (UTC) ... Done, the code is winecase, it displays case (no abbreviation) linking to Case (goods) & conversion is to litres by default. Jɪmp 14:47, 27 February 2008 (UTC)[reply]
Great. Thank you.

On a slightly related note, I can't seem to get hectoliters working with "triple combinations", would it be a simple matter of turning this on or more hassle than it's worth? MURGH disc. 05:52, 11 March 2008 (UTC)[reply]

It's no great hassle, what combinations are you after (e.g. hl impgal USgal)? Jɪmp 06:37, 11 March 2008 (UTC)[reply]
Okay, I've added eight triple combinations with hectolitres & gallons. Whether imperial or US gallons come first is optional, whether US is dotted or not is optional and whether hectolitres is abbreviated as "hl" or "hL" is optional.
  1. hl impgal USgal
  2. hl impgal U.S.gal
  3. hL impgal USgal
  4. hL impgal U.S.gal
  5. hl USgal impgal
  6. hl U.S.gal impgal
  7. hL USgal impgal
  8. hL U.S.gal impgal
Of course, as usual, spelling hectolitre as hectolitre or hectoliter is also optional use the sp parameter. Jɪmp 07:10, 11 March 2008 (UTC)[reply]
Super! That covers all the needs I can think of  :)
OK, now I see. One I'd like to express is {{convert|2500|winecase|hl USgal|3|lk=on|abbr=off}} MURGH disc. 12:05, 11 March 2008 (UTC)[reply]
Done. Jɪmp 15:14, 11 March 2008 (UTC) ... I've also made "US" vs "U.S." and "hl" vs "hL" optional as with the triple combos above and covered hectolitre-imperial gallon combinations too.[reply]
  1. hl impgal
  2. hL impgal
  3. hl USgal
  4. hl U.S.gal
  5. hL USgal
  6. hL U.S.gal
By the way, the default for abbr is off so abbr=off is not usually necessary. Jɪmp 16:07, 11 March 2008 (UTC)[reply]
Great. Thanks again. Yes I was wondering why it abbreviated default-like, I was hoping there was an option for nonabbreviated units. MURGH disc. 21:17, 11 March 2008 (UTC)[reply]
You mean the units within the brackets. No, the template abbreviates the units for conversions which appear brackets in accordance with MOS:NUM#Conversions, unless, of course there is no abbreviation. Jɪmp 00:43, 12 March 2008 (UTC)[reply]

Support for bbl, long ton

[edit]

I consider myself fairly handy with templates, but as someone noted above, these seem pretty hairy...

Could someone provide support for these two units:

These units are widely used in articles about ships and the shipping industry.

Thanks! HausTalk 22:51, 28 February 2008 (UTC)[reply]

The code for the oil barrel is oilbbl. The conversion factor it uses is 1 bbl ≡ 0.158987294928 m³ (42 US gal).
The codes for the long ton are LT and L/T these corespond to the abbreviations the template will output, use whichever you prefer ... of course, if you're spelling it out it makes no difference which you use. I'm thinking of adding code to force the unit to be spelt out in case editors don't feel that either "LT" or "L/T" are well enough recognised. It might also be good to be able to drop the "long" for contexts (e.g. shipping) where this is the only ton used (not counting the tonne i.e. "metric ton"). Same story for the short ones.
Jɪmp 23:48, 28 February 2008 (UTC)[reply]
I believe that dropping the long would going against the MOSNUM as it asks to differentiate between long and short tons in the same manner as imperial and U.S. gallon. It's probably best to leave it in. I do like the idea of having long/short ton spelled out in the parenthesis, i.e. 1,510 metric tons (1,664 short tons). I'm —MJCdetroit (yak) and I approved this message 00:27, 29 February 2008 (UTC)[reply]
That's pretty much my feeling too but I do feel like a bit of an intruder when I insert a long into ship infoboxes I edit when none of them make the distinction ... on the other hand, they probably should: how's your average Joe Blow to know that they don't use short tons for ships even in the US? Jɪmp 01:42, 29 February 2008 (UTC)[reply]
Wow, thanks for jumping on that so quickl! TYour discussion brings us to the next item I had on my list: a template for deadweight tons. What I was thinking about was something like {{dwt|30,000|long}} to give 30,000 [[deadweight tons]] (DWT) (xxx deadweight tonnes). and {{dwt|30,000|brief}} to give 30,000 DWT (xxx deadweight tonnes). Any feelings? Cheers, HausTalk 02:07, 29 February 2008 (UTC)[reply]
Deadweight tonnes/tons could be added to {{convert}} without too much trouble. Note that [[deadweight ton]] is a redirect to Tonnage so we'd by-pass that. The template normally outputs either the full name of the unit or its abbreviation the rules by which this is done are pretty straight-forward (except when disp=table):
  1. For units without abbreviations the unit is always spelt out.
  2. Otherwise units are always abbreviated when in brackets.
  3. Other-otherwise units are spelt out unless abbr=on.
Note, however, that I had been discussing having forced spelling out of long ton and short ton where there exists abbreviations. What I've got in mind here is a new code which will make the template behave as if there is no abbreviation. The same could be done in order to get your full "deadweight tons (DWT)" form, however, the way the template is set up (without doing a ton of work) the linking will be like this [[tonnage|deadweight tons (DWT)]] (i.e. the "DWT" will be included). So am I right to assume that a deadweight ton is basically a long ton worth of deadweight (and similarly for a deadweight tonne)? Am I right in reading you that DWT stands (exclusively) for deadweight tons (not deadweight tonnes)? Is there an abbreviation for deadweight tonnes? What I've got in mind is the following coding:
DWT for "deadweight tons" or "DWT": switch between abbreviations & spelt-out forms in the usual way
DWT-full for "deadweight tons (DWT)": the full version (I'm not too keen on calling it "long" for fear of confusion with long verses short tons.)
DWtonne for "deadweight tonnes"
Would that make sense? Jɪmp 03:23, 29 February 2008 (UTC) ... P.S. Be careful not to get DWT confused with dwt or we'll be out by a factor of 653,333⅓. Jɪmp 03:29, 29 February 2008 (UTC) P.P.S. Codes long ton, short ton & metric ton now force the units names to be spelt out. Jɪmp 03:39, 29 February 2008 (UTC)[reply]
Your approach looks great to me. Some answers:
1. In the U.S. a DWT is always a long ton of deadweight.
2. I've found examples outside the U.S. (at Det Norske Veritas) of a DWT being a long ton of deadweight.
3. I've found examples outside the U.S. of a DWT being a deadweight tonne.
I think the only way of avoiding confusion is picking a Wikipedia standard and using it.
Hope that helps. HausTalk 04:59, 29 February 2008 (UTC)[reply]
Of course, picking a Wikipedia standard and using it might not be as simple as it sounds. One bunch of editors may pick one and use it, the next bunch might follow suit, another bunch might deliberately ignor the choice, the next bunch might never have read that there was ever a choice made in the first place. What about the readers? How's the average reader to know that we'd made a decision that "DWT" will always stand for this or for that?
I did a bit of a Google and found that it is a bit of a mixed bag. Most of the "DWT"s I ran across were long but there were a fair number of metric ones about. Russ Rowlett's Dictionary of Units of Measurement had this to say.

deadweight ton (dwt)
a traditional unit of weight or mass used in the shipping industry. The deadweight tonnage of a ship is the difference between its weight when completely empty and its weight when fully loaded. This includes the weight of everything portable carried by the ship: the cargo, fuel, supplies, crew, and passengers. The deadweight ton is traditionally equal to the British ("long") ton of 2240 pounds (1016.047 kilograms). However, more and more often it is being taken to equal the metric ton (exactly 1000 kilograms, or 2204.623 pounds).

If we settle on having "DWT" stand for "deadweight long ton", might we not fall behind the times ... eventually? Another way of avoiding the confusion may be to always spell the units out or to add dsiambiguation to the abbreviation e.g. "DWT (metric)" vs "DWT (long)" "DWTmetric" vs "DWTlong"
Jɪmp 21:01, 2 March 2008 (UTC)[reply]

outdent← On the other hand, if a Wikipedia standard is chosen, the template will follow the choice. However, any such decision will, of course, need discussion on a more general forum than this talk page. It'd have to be discussed at WT:MOSNUM and the relavant project talk page (I'm sure you, Haus, have a better idea than I of where that might be). In the meantime, these two new codes which I've introduced might be useful.

  • DWtonne, as mentioned above:
    • defined as 1000 kg (one tonne),
    • the unit is always spelt out deadweight tonne,
    • when you turn linking on the unit name links to Tonnage,
    • the default conversion is to DWton
  • DWton, similarly:
    • defined as 1016.0469088 kg (one long ton),
    • the unit is always spelt out deadweight ton,
    • when you turn linking on the unit name links to Tonnage,
    • the default conversion is to DWtonne

Note that as these both link to the same article it might be best to use lk=in to link only the first (the input).Jɪmp 02:25, 3 March 2008 (UTC) (P.S. By the way if you want to use the codes I mentioned above to force long/short/metric ton to be spelt out, don't use the plural, use e.g. {{convert|100|long ton|0}}.) Jɪmp 02:39, 3 March 2008 (UTC)[reply]

As you seem to be something of a mover and shaker at WT:MOSNUM, can I suggest you kick the discussion off and I'll pitch in as seems fit? I'll then mention the thread at WT:MTD and WT:SHIPS to see if we can get any SME input. Cheers. HausTalk 02:55, 3 March 2008 (UTC)[reply]
I haven't been moving much over there of late & I dunno how much I shake. I can give it a whirl but I've gotta say that my preference would be to avoid plain "DWT" in favour of "DWT (metric)" vs "DWT (long)" to avoid confusion (esp. to make it clear for non-shipping-buffs that don't realise that a ton at sea is never short). The subscripts, whilst nice & compact, might be a little to close to our own invented abrreviations. Jɪmp 03:24, 3 March 2008 (UTC)[reply]
I like the subscripts. —MJCdetroit (yak) 14:11, 3 March 2008 (UTC)[reply]
Me too, æsthetically speaking. My fear, however, is that it could be argued that a subscript is part of the symbol therefore "DWTmetric" & "DWTlong" could be seen as being symbols of our own invention. Shall we take it to MOSNUM? Jɪmp 23:46, 3 March 2008 (UTC)[reply]
Let's continue @ WT:MOSNUM#DWT. Jɪmp 06:13, 4 March 2008 (UTC)[reply]

Changing the defualt conversions

[edit]

Foot-pounds force etc.

[edit]

Until now the default conversion for foot-pounds (force) (codes ftlb, ftlb-f & ftlbf) had been to joules. I noticed that the subtemplates involved were mainly used on automotive articles where torque is almost certainly what is meant.

I've changed the default to newton-metres in line with that of pound (force)-feet. Now we don't have to remember which way that old-standing convention that never was consistantly applied went. Jɪmp 01:58, 5 March 2008 (UTC)[reply]

Okay, a lot of gun articles also transclude {{convert/ftlbf}} and in this case it's joules which are intended. I've fixed .700 Nitro Express‎ which was relying on the default to joules. I don't see any other main-space transclusions which rely on default conversion. Jɪmp 03:42, 5 March 2008 (UTC)[reply]
I've done the same to the inch-pound force and inch-ounce force subtemplates. Jɪmp 03:51, 5 March 2008 (UTC)[reply]

Grains

[edit]

The default for grains has also been changed from milligrams to grams since this was the overwhelming preference (everwhere I checked except for when Judy Garland topped herself — used mostly for bullets & gun powder — more death). Jɪmp 02:21, 12 March 2008 (UTC)[reply]

Context and liquid/dry units

[edit]

Is there a way to, for example, make fluid ounces show up as only "oz" in the output of the template, where it's clear from context what is meant? —Random832 15:34, 7 March 2008 (UTC)[reply]

Not at the moment but it wouldn't be too hard to do. Jɪmp 15:45, 7 March 2008 (UTC)[reply]
Use (impfl)oz or (usfl)oz. Jɪmp 15:54, 7 March 2008 (UTC)[reply]
To have the code display it as such is actually in violation of the WP:MOSNUM. Even if it is clear that the ounce being discussed is a fluid ounce. We should probably drop this part of the code before it becomes trouble for us in the future. —MJCdetroit (yak) 18:36, 11 March 2008 (UTC)[reply]
Good point. You could argue that where context made the meaning clear the spirit of MOSNUM is still adhered to, though, there'd be no guarantee that editors make sure that the context be sufficient before using these. Yeah, it may be safest to adhere strictly to the letter of the law and not make interpretations which might lead to strife. The subtemplates in question are the following.
They are not currently in use. I don't have any objection to their deletion. Jɪmp 02:11, 12 March 2008 (UTC)[reply]
In order to be as MOSNUM "friendly" as possible—let's delete 'em. This template was recommended by the MOSNUM because of its compliance with MOSNUM, let's not change that. —MJCdetroit (yak) 03:40, 12 March 2008 (UTC)[reply]

I'd have liked to be able to use the template to have e.g. "16 oz (473 ml)" in articles, but I guess it can just be put in manually, especially since the quantity in ml is on the label as well anyway. —Random832 17:04, 17 March 2008 (UTC)[reply]

I do think there should be a way to display only "fl.oz." - yes, there is more than one unit called that, but having to specify which one every time contradicts WP:ENGVAR. —Random832 17:05, 17 March 2008 (UTC)[reply]

If MOSNUM says to specify what you mean with each use & ENGVAR says not to, then we've got a problem with the MOS. There seem to be good arguments on both sides but this should probably be wrestled through at WT:MOS & WT:MOSNUM. We shouldn't be going against the MOS but nor should we have an MOS which goes against itself. Jɪmp 05:07, 19 March 2008 (UTC)[reply]
I didn't see where this contradiction is at over at ENGVAR. Could a direct quote be given? —MJCdetroit (yak) 15:38, 19 March 2008 (UTC)[reply]
This is not an ENGVAR issue. Gene Nygaard (talk) 01:49, 31 March 2008 (UTC)[reply]
"Fluid ounce" is the American English term for the US fluid ounce. —Random832 (contribs) 14:15, 31 March 2008 (UTC)[reply]

No contradiction, MOSNUM actually has language permitting some use use of "fl.oz." alone:

  • Use fluid ounce explicitly to avoid confusion with weight, and specify, if appropriate, Imperial, U.S. or other.

"if appropriate" doesn't say much, but I'd say common sense is that it's acceptable to leave it off when it has already been specified, or when it is an unambiguously US or UK topic. —Random832 (contribs) 01:35, 31 March 2008 (UTC)[reply]

That deals with words, not with symbols. The distinctions metrologists make between their "symbols" and ordinary abbreviations are relevant here. We should not be displaying fluid ounces with the abbreviation "oz" (and, as the MoS says, none of our unit symbols should have the dots that Random832 uses above). Gene Nygaard (talk) 01:47, 31 March 2008 (UTC)[reply]

There are, however, as MOSNUM points out, cases in which U.S. fluid ounces need to be distinguished from imperial fluid ounces? Is that handled by the template? Is what you get if you use the "floz" parameter made clear in the documentation? I see a discussion of the parameters USfloz and impfloz. But the parameter "floz" gives us something. What is it? I don't see any explanation in the documentation. Trying it shows that it gives us both, but the documentation doesn't tell us that in what I see:

{{convert|28|g|floz}} → 28 grams ([convert: unit mismatch])

Granted, using it for the "from" units gives an error message. But how many editors are going to be able to figure out from that error message what is wrong, and why the conversion they are trying to use won't work? Most are just going to throw up there hands, and give up on a worthless template.

We should not be displaying fluid ounces with the abbreviation "oz" - have you made any argument for not displaying them with the abbreviation "fl oz"? The distinctions metrologists make between their "symbols" and ordinary abbreviations are relevant here. - That distinction is being inappropriately imported from SI - with the units used in the US, an abbreviation is an abbreviation. This template allows "mph" where the proper "symbol" would be "mi/h". And MOSNUM itself enshrines "sq mi" in an explicit example whereas if we were sticking to "symbols" it would have to be "mi²". —Random832 (contribs) 14:03, 31 March 2008 (UTC)[reply]

Please create the units "(imp)floz" and "(us)floz", with identical conversion factors to "impfloz" and "usfloz" respectively, the name "fluid ounce[s]", and the abbreviation "fl oz". Usage of these is permitted by the manual of style. Same should probably also be done for pints, quarts, gallons etc. —Random832 (contribs) 14:19, 31 March 2008 (UTC)[reply]

textual version

[edit]

I think it'd be nice to have a parameter to choose viewing the values in text format (like {{numtext}} does). a parameter like text=on could be used, what do you think? --Waldir talk 14:21, 9 March 2008 (UTC)[reply]

Hear, hear. Fully agree. Would help with MoS for numbers (in words if number can be represented in one word, including hyphens). How about the ability to select input value, output value or both in words? Suggest a parameter name of wrd? wrd=in, wrd=out, wrd=on. Damn. Forgot to sign. Bleakcomb (talk) 04:43, 11 March 2008 (UTC)[reply]
Be aware there appears to be some bugs in {{numtext}} - check out the examples. So be careful leveraging that code. :) MeekMark (talk) 01:31, 11 March 2008 (UTC)[reply]
Don't take this as a "no" but I don't believe the WP:MOSNUM guidelines on spelling numbers out were ever meant to apply to measurements (if they did, then MOSNUM is breaking its own rules). This is not to say that such a feature wouldn't be nice. Let's not get carried away, though; would "the ability to select input value, output value or both in words" be necessary, useful or even desirable? There are (currently) three display modes supported by the template:
  1. bracket mode
  2. slash mode
  3. table mode
In bracket mode the input units are either spelt out or abbreviated & the output units are always abbreviated per MOSNUM. You don't spell numbers out if the unit is abbreviated. Slash mode is more or less a form of a list, MOSNUM suggested that either all or none of the numbers in a list be spelt out; in any case, slash mode is most useful where the input & output are both inside brackets, numerals and abbreviations are generally most appropriate inside brackets. Spelling numbers out in a table is generally undesireable, so this feature would be unnecessary in table mode.
I'd therefore suggest that
  1. in bracket mode any such feature only apply to the input,
  2. in slash mode (if the feature be extended this far) it apply equally to input & output and
  3. in table mode there be no such option.
Jɪmp 04:07, 11 March 2008 (UTC)[reply]
That all sounds good. Bleakcomb (talk) 04:47, 11 March 2008 (UTC)[reply]
One of the cases this would be desirable, IMO, is for simple (input) values such as 1 metre (3 ft 3 in)
(btw something in this page is breaking the section edit links. I had to manually change the url from section=29 to section=31 so I could edit this section... Waldir talk 02:31, 12 March 2008 (UTC)[reply]
That's odd. It could have something to do with my splitting up of Changing the defualt conversions (above into two subsections) ten minutes prior to your post. Jɪmp 03:05, 12 March 2008 (UTC)[reply]

SUBST'ing yes or no?

[edit]

And if yes, please include it prominently in the documentation, including all code examples. Dorftrottel (bait) 18:37, March 15, 2008

And ditto if "no", please. - Neparis (talk) 00:55, 17 March 2008 (UTC)[reply]
It would take forever to subst it but you could use Special:ExpandTemplates. Jɪmp 16:45, 17 March 2008 (UTC) ... I've added a note to the doc. Jɪmp 16:55, 17 March 2008 (UTC)[reply]

Hyphens

[edit]

Why doesn't "adj=on" work for abbreviated units? For example, "25 mm (1.0 in) gun" needs a hyphen to be inline with MOS. Epbr123 (talk) 10:27, 25 March 2008 (UTC)[reply]

Because the MoS actually says the opposite.

Values and units used as compound adjectives are hyphenated only where the unit is given as a whole word. Where hyphens are not used, values and units are always separated by a non-breaking space ( ).

Incorrect: 9-mm gap
Correct: 9 mm gap (entered as 9 mm gap)
Incorrect:    9 millimetre gap
Correct: 9-millimetre gap
Correct: 12-hour shift
Correct: 12 h shift
Jɪmp 18:14, 25 March 2008 (UTC)[reply]