Template talk:Convert/Archive May 2012

From WikiProjectMed
Jump to navigation Jump to search

Bushels

For Port of Albany–Rensselaer#Facilities, is there a template that will convert 13.5 million bushel to m3. Peter Horn User talk 23:43, 28 April 2012 (UTC)

The unit is bushel: 13,500,000 bsh[convert: unknown unit] or 13,500,000 bu ([convert: unit mismatch]). Whoopee, the second one works! Peter Horn User talk 01:23, 5 May 2012 (UTC)
Strange, I just noticed that "abbr=off" did not modify the input. 13,500,000-bu ([convert: unit mismatch]) does the same thing. Peter Horn User talk 01:44, 5 May 2012 (UTC)

Adjective form

On Abraj_Al_Bait#Description, is there any way to get "A 71-metre-tall spire (233 ft)" to be "A 71-metre-tall spire (233 feet)"? Or should it really be "A 71-metre-tall (233-foot) spire"?

81.159.21.217 (talk) 13:31, 29 April 2012 (UTC)

  • Using afterthought syntax: If using full unit names, then "233-foot" would be correct; however, we typically abbreviate as "ft" so a common format would be:
  • {{convert|71|m|ft|adj=mid|-tall}} → 71-metre-tall (233 ft)
Otherwise, the original form is acceptable, as "71-metre-tall spire (233 ft)", in the sense that the "tall spire" is a connected phrase, which might be a more direct way to convey the idea to readers, rather than "71-metre-tall (233 ft) spire". I refer to the appendage of "(233 ft)" after the spire description as being an "afterthought syntax" which is quite common for many readers. For example, a person could easily follow the phrase:
  • "He failed the exam completely (score: 20 of 100)."
with the score stated as an afterthought, rather than:
  • "He failed (score: 20 of 100) the exam completely."
Often it is better to complete the initial thought first, as "71-metre-tall spire" and then tack the conversion at the end, as an afterthought, being "(233 ft)" rather than interleave the conversion before the description is completed. Hence, the following is likely to be the best for readers:
  • {{convert|71|m|ft|adj=mid|-tall spire}} → 71-metre-tall spire (233 ft)
I hope that explains the reasoning in this case. -Wikid77 (talk) 02:09, 6 May 2012 (UTC)

Displaying USre-type unit names

The Template:Convert/LoffAoffDunitSoffUSre needs to be rewritten to show "US" in the unit name when option "disp=unit" is used, as shown below:

  • {{convert|3|usgal|L}}       → 3 US gallons (11 L)
  • {{convert|3|usgal|L|disp=unit}} → US gallons

So, to show "US" just replace Template:Convert/LoffAoffDunitSoffUSre as the contents of the related Template:Convert/LoffAoffDunitSoffUSer and change "U.S." to "US". The following test data will confirm the update:

  • Expected: {{convert|3|usgal|L|disp=unit}} → US gallons
  • Currently: {{convert|3|usgal|L|disp=unit}} → US gallons
  • Expected: {{convert|7|usgal|impgal|disp=unit}} → US gallons
  • Currently: {{convert|7|usgal|impgal|disp=unit}} → US gallons
  • Expected: {{convert|7|usgal|impgal|disp=unit|sp=us}} → U.S. gallons
  • Currently: {{convert|7|usgal|impgal|disp=unit|sp=us}} → U.S. gallons
  • Expected: {{convert|3|impgal|L|disp=unit}} → imperial gallons
  • Currently: {{convert|3|impgal|L|disp=unit}} → imperial gallons

After update, all Expected/Current should match. -Wikid77 13:42, 27 April 2012 (UTC)

 Done -- WOSlinker (talk) 13:35, 6 May 2012 (UTC)

This edit has broken the cases where the unit was specified as "gal":

  • Expected: {{convert|3|gal|L}}       → 3 US gallons (11 L)
  • Currently: {{convert|3|gal|L|disp=unit}} → US gallons
  • Expected: {{convert|3|gal|L|disp=unit}} → US gallons
  • Currently: {{convert|3|gal|L|disp=unit}} → US gallons
  • Expected: {{convert|7|gal|impgal|disp=unit}} → US gallons
  • Currently: {{convert|7|gal|impgal|disp=unit}} → US gallons
  • Expected: {{convert|7|gal|impgal|disp=unit|sp=us}} → U.S. gallons
  • Currently: {{convert|7|gal|impgal|disp=unit|sp=us}} → U.S. gallons
eraser Undone -- WOSlinker (talk) 19:14, 6 May 2012 (UTC)

Still doesn't support

"feet". Pretty major omission for something that does support "grain-force". — LlywelynII 18:02, 6 May 2012 (UTC)

I'm not sure what you are saying? This works: 80 feet (24 m)? Thanks! Plastikspork ―Œ(talk) 18:47, 6 May 2012 (UTC)

Single output not available and link do not work

For User:Peter Horn#Sandboxes and for ton:

or

  • 210 and 256 US gallons (790 and 970 L; 175 and 213 imp gal)
  • 210 and 256 US gallons (790 and 970 L; 175 and 213 imp gal)
  • 210 and 256 US gallons (790 and 970 L)
  • 210 and 256 US gallons (790 and 970 L)

It is so far impossible to make "lk=in" or "lk=on" work and to get a single output! Peter Horn User talk 23:21, 6 May 2012 (UTC)

  • 210 and 256 imperial gallons (950 and 1,160 L)
  • 210 and 256 imperial gallons (950 and 1,160 L)
  • 210 and 256 US gallons (790 and 970 L)
  • 210 and 256 US gallons (790 and 970 L)

I stand corrected, it is "lk=in" or "lk=on" that are not yet supported. Peter Horn User talk 23:47, 6 May 2012 (UTC)

  • Those options deleted in August 2011: Those options of "lk=on" and "lk=in" for imperial or USre units were deleted by Jimp in August 2011. I think the plan was to simplify unit-codes "impgal" and "usgal" to use fewer subtemplates but allow all the options. I had tried using Convert/2 to get more options, so I had to add more subtemplates there:
  • {{convert|210|and|256|impgal|L|lk=on}} → 210 and 256 imperial gallons (950 and 1,160 L)
  • {{convert/2 |210|and|256|impgal|L|lk=on}} → {{convert/2|210|and|256|impgal|L|lk=on}}
  • {{convert/2 |210|and|256|impgal|L|lk=in}} → {{convert/2|210|and|256|impgal|L|lk=in}}
Also, use the unit-code with capital letters "USgal":
  • {{convert|130|and|186|USgal|lk=on}} → 130 and 186 US gallons (490 and 700 L; 108 and 155 imp gal)
  • {{convert|130|and|186|USgal|lk=in}} → 130 and 186 US gallons (490 and 700 L; 108 and 155 imp gal)
Jimp has been on wikibreak, so we can discuss again later, how to simplify the hundreds of subtemplates needed to handle the imperial, USre and USer-style units. -Wikid77 (talk) 20:43/21:18, 7 May 2012 (UTC)

Fracture gradient

In the hydraulic fracturing, a unit called 'fracture gradient' is used. It is the pressure to fracture the shale formation at a particular depth divided by the depth. E.g. a fracture gradient of 18 kPa/m implies that at a depth of 3 km (10,000 feet) a pressure of 54 MPa (8,000 psi) will extend a hydraulic fracture. Is it possible to add conversion of kPa/m to psi/foot? I knew this is very specific unit but maybe it could be added. Thank you. Beagel (talk) 12:30, 9 May 2012 (UTC)

  • DONE - The conversion can be coded as follows:
  • {{convert|1.0000000|kPa/m|psi/ft}} → 1.0000000 kilopascal per metre (0.04420750 psi/ft)
  • {{convert|10|kPa/m|psi/ft}} → 10 kilopascals per metre (0.44 psi/ft)
The results can be checked against a similar conversion in Google, although the numbers in Google might be off in a few digits. Sorry for the 3-day delay, because I was unaware of the "fracture gradient" units, which seemed very unusual, and require such complex conversions. To adjust the default precision, edit Template:Convert/psi/ft to reset "|j=4-{{{j|0}}}" to "j=5..." or such. -Wikid77 15:25, 12 May 2012 (UTC)

New disp=preunit allows "+" before units

I have updated the new option "disp=preunit" (which displays text before each unit name or symbol) to allowing placing a "+" after a numeric amount. In general, the first preunit text is displayed from parameter 4, and the 2nd pre-unit text from parameter 5 (else repeats text from parameter 4).

Examples
  • {{convert|4|m|ft|disp=preunit|+ }} → 4+ metres (13+ ft)
  • {{convert|4|m|ft|disp=preunit|+ | or more }} → 4+ metres (13 or more ft)
  • {{convert|9|m|ft|disp=preunit|+ |+ |1}} → 9+ metres (29.5+ ft)
  • {{convert|40|kg|lb|disp=preunit|exact | |3}} → 40 exact kilograms (88.185 exact lb)
  • {{convert|40|kg|lb|disp=preunit|exact | |3}} → 40 exact kilograms (88.185 lb)

Note that leaving parameter 5 as blank will repeat the preunit text from parameter 4, and allow parameter 6 to set the rounding (here, as 3 decimal digits). To omit the 2nd preunit text, then code parameter 5 as a space character, " ".

If parameter 4 is a plus sign ("+"), then no space is inserted before the plus sign. -Wikid77 (talk) 22:02, 20 May 2012 (UTC)

A new one

For DBAG Class 101#Brake system and traction motors 4.22 kN•m Peter Horn User talk 23:48, 30 May 2012 (UTC)

One newton-metre is equal to one joule, so specify the unit as kilojoules (kJ), and explicitly request conversion to Foot-pound (energy) (the default conversion being to calories), like this. --Redrose64 (talk) 09:49, 31 May 2012 (UTC)