Template talk:Convert/Archive May 2012

Bushels
For Port of Albany–Rensselaer, 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: 13500000 bsh or 13500000 bu. 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. 13500000 bu does the same thing. Peter Horn User talk 01:44, 5 May 2012 (UTC)

Adjective form
On Abraj_Al_Bait, 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:
 * {&#123;convert|71|m|ft|adj=mid|-tall}} &rarr; 71 m
 * 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:
 * {&#123;convert|71|m|ft|adj=mid|-tall spire}} &rarr; 71 m
 * 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:
 * {&#123;convert|3|usgal|L}}      &rarr; 3 usgal
 * {&#123;convert|3|usgal|L|disp=unit}} &rarr; 3 usgal

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: {&#123;convert|3|usgal|L|disp=unit}} &rarr; US gallons
 * Currently: {&#123;convert|3|usgal|L|disp=unit}} &rarr; 3 usgal


 * Expected: {&#123;convert|7|usgal|impgal|disp=unit}} &rarr; US gallons
 * Currently: {&#123;convert|7|usgal|impgal|disp=unit}} &rarr; 7 usgal


 * Expected: {&#123;convert|7|usgal|impgal|disp=unit|sp=us}} &rarr; U.S. gallons
 * Currently: {&#123;convert|7|usgal|impgal|disp=unit|sp=us}} &rarr; 7 usgal


 * Expected: {&#123;convert|3|impgal|L|disp=unit}} &rarr; imperial gallons
 * Currently: {&#123;convert|3|impgal|L|disp=unit}} &rarr; 3 impgal

After update, all Expected/Current should match. -Wikid77 13:42, 27 April 2012 (UTC)
 * ✅ -- WOSlinker (talk) 13:35, 6 May 2012 (UTC)

This edit has broken the cases where the unit was specified as "gal":
 * Expected: {&#123;convert|3|gal|L}}      &rarr; 3 gal
 * Currently: {&#123;convert|3|gal|L|disp=unit}} &rarr; 3 gal


 * Expected: {&#123;convert|3|gal|L|disp=unit}} &rarr; US gallons
 * Currently: {&#123;convert|3|gal|L|disp=unit}} &rarr; 3 gal


 * Expected: {&#123;convert|7|gal|impgal|disp=unit}} &rarr; US gallons
 * Currently: {&#123;convert|7|gal|impgal|disp=unit}} &rarr; 7 gal


 * Expected: {&#123;convert|7|gal|impgal|disp=unit|sp=us}} &rarr; U.S. gallons
 * Currently: {&#123;convert|7|gal|impgal|disp=unit|sp=us}} &rarr; 7 gal


 * -- 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 ft?  Thanks! Plastikspork ―Œ (talk)  18:47, 6 May 2012 (UTC)

Single output not available and link do not work
For User:Peter Horn and for ton: or 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) 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)
 * 210 and 256 impgal
 * 210 and 256 impgal
 * 210 and 256 impgal
 * 210 and 256 impgal
 * 210 and 256 usgal
 * 210 and 256 usgal
 * 210 and 256 usgal
 * 210 and 256 usgal
 * 210 and 256 impgal
 * 210 and 256 impgal
 * 210 and 256 usgal
 * 210 and 256 usgal
 * 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:
 * {&#123;convert|210|and|256|impgal|L|lk=on}} &rarr; 210 and 256 impgal
 * {&#123;convert/2 |210|and|256|impgal|L|lk=on}} &rarr;
 * {&#123;convert/2 |210|and|256|impgal|L|lk=in}} &rarr;
 * Also, use the unit-code with capital letters "USgal":
 * {&#123;convert|130|and|186|USgal|lk=on}} &rarr; 130 and 186 USgal
 * {&#123;convert|130|and|186|USgal|lk=in}} &rarr; 130 and 186 USgal
 * 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:
 * {&#123;convert|1.0000000|kPa/m|psi/ft}} &rarr; 1.0000000 kPa/m
 * {&#123;convert|10|kPa/m|psi/ft}} &rarr; 10 kPa/m
 * 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- " 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
 * {&#123;convert|4|m|ft|disp=preunit|+ }} &rarr; 4 m
 * {&#123;convert|4|m|ft|disp=preunit|+ | or more }} &rarr; 4 m
 * {&#123;convert|9|m|ft|disp=preunit|+ |+ |1}} &rarr; 9 m
 * {&#123;convert|40|kg|lb|disp=preunit|exact | |3}} &rarr; 40 kg
 * {&#123;convert|40|kg|lb|disp=preunit|exact |&amp;#32;|3}} &rarr; 40 kg

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, "&amp;#32;".

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 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), . -- Red rose64 (talk) 09:49, 31 May 2012 (UTC)