A Project of the Center for Advanced Study in the Visual Arts, National Gallery of Art
History of Early American Landscape Design

Template:Convert/4

[http://www.nga.gov/content/ngaweb/research/casva/research-projects.html A Project of the National Gallery of Art, Center for Advanced Study in the Visual Arts ]
< Template:Convert
Revision as of 17:26, April 18, 2012 by Emily Pugh (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

10×20×30×40 metres (Template:Hid{{#invoke:Math|precision_format| (10)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (20)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (30)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (40)*1/0.3048 | 1-2 }} ft)

The converter Template:Convert/4 will convert 4 amounts at once, allowing a mix of different range words between the 4 amounts. However, all 4 amounts are treated as the same unit type. The output unit must be specified, or put "0" to default.
Usage:  {{convert/4 |1|by|2|by|3|by|4|m|ft}}
{{convert/4 |1|x|2|x|3|x|4|m|ft}}
{{convert/4 |1|-|2|-|3|-|4|m|ft}}
{{convert/4 |7|to|8|by|3|to|4.5|km|mi|abbr=on}}

The template has the same parameters as Template:Convert, and so it allows abbreviation abbr=in or abbr=out or abbr=off, wikilinks lk=in or lk=out, and adjective mode adj=on or adj=mid. The separator can also be a semicolon: disp=semi, disp=semicolon, disp=or, disp=comma, disp=x (customized), disp=b (default as parentheses) and "disp=output only".

Examples

The examples show a mixture of "by" & "x" or "to" or "rarely" (etc.) in some conversions:

  • {{convert/4 |5|by|6|or|7|by|8|m|ft}}     gives: 5 by 6 or 7 by 8 metres (Template:Hid{{#invoke:Math|precision_format| (5)*1/0.3048 | 1-1 }} by Template:Hid{{#invoke:Math|precision_format| (6)*1/0.3048 | 1-1 }} or Template:Hid{{#invoke:Math|precision_format| (7)*1/0.3048 | 1-1 }} by Template:Hid{{#invoke:Math|precision_format| (8)*1/0.3048 | 1-1 }} ft)
  • {{convert/4 |5|x|6|x|7|up to|8|m|ft}} gives: 5×6×7 up to 8 metres (Template:Hid{{#invoke:Math|precision_format| (5)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (6)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (7)*1/0.3048 | 1-1 }} up to Template:Hid{{#invoke:Math|precision_format| (8)*1/0.3048 | 1-1 }} ft)
  • {{convert/4 |7|to|8|,|9|or|10|km|mi}} gives: 7 to 8, 9 or 10 kilometres (Template:Hid{{#invoke:Math|precision_format| (7)*1,000/1,609.344 | 1-0 }} to Template:Hid{{#invoke:Math|precision_format| (8)*1,000/1,609.344 | 1-0 }}, Template:Hid{{#invoke:Math|precision_format| (9)*1,000/1,609.344 | 1-0 }} or Template:Hid{{#invoke:Math|precision_format| (10)*1,000/1,609.344 | 1-0 }} mi)
  • {{convert/4 |7|to|8|not|9|to|10|km|mi|abbr=on}}    gives: 7 to 8 not 9 to 10 Template:Convert/LoffAonDunitSoff (Template:Hid{{#invoke:Math|precision_format| (7)*1,000/1,609.344 | 1-0 }} to Template:Hid{{#invoke:Math|precision_format| (8)*1,000/1,609.344 | 1-0 }} not Template:Hid{{#invoke:Math|precision_format| (9)*1,000/1,609.344 | 1-0 }} to Template:Hid{{#invoke:Math|precision_format| (10)*1,000/1,609.344 | 1-0 }} mi)
  • {{convert/4 |7|to|8|to|9|to|10|km|mi|adj=on}}      gives: 7-to-8-to-9-to-10-Template:Convert/LoffAoffDunitSonTemplate:Convert/track/adj/on (Template:Hid{{#invoke:Math|precision_format| (7)*1,000/1,609.344 | 1-0 }}-to-Template:Hid{{#invoke:Math|precision_format| (8)*1,000/1,609.344 | 1-0 }}-to-Template:Hid{{#invoke:Math|precision_format| (9)*1,000/1,609.344 | 1-0 }}-to-Template:Convert/LoffAonDoutput onlySonTemplate:Convert/track/adj/on)
  • {{convert/4 |5|to|6|rarely|7|to|8|m|ft}} → 5 to 6 rarely 7 to 8 metres (Template:Hid{{#invoke:Math|precision_format| (5)*1/0.3048 | 1-1 }} to Template:Hid{{#invoke:Math|precision_format| (6)*1/0.3048 | 1-1 }} rarely Template:Hid{{#invoke:Math|precision_format| (7)*1/0.3048 | 1-1 }} to Template:Hid{{#invoke:Math|precision_format| (8)*1/0.3048 | 1-1 }} ft)
  • {{convert/4 |5|x|6|by|7|-|8|m|ft}} → 5×6 by 7–8 metres (Template:Hid{{#invoke:Math|precision_format| (5)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (6)*1/0.3048 | 1-1 }} by Template:Hid{{#invoke:Math|precision_format| (7)*1/0.3048 | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| (8)*1/0.3048 | 1-1 }} ft)
  • {{convert/4 |10|-|20|, summer|25|-|30|°C|F|disp=or}} → 10–20, summer 30–40 °C or Template:Hid{{#invoke:Math|precision_format| ((10+273.15)*1.8-459.67) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| ((20+273.15)*1.8-459.67) | 1-1 }}, summer Template:Hid{{#invoke:Math|precision_format| ((30+273.15)*1.8-459.67) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| ((40+273.15)*1.8-459.67) | 1-2 }} °F
  • {{convert/4 |11|-|13|-|15|-|17|°C|F|disp=semi}}     gives: 11–13–15–17 °C; Template:Hid{{#invoke:Math|precision_format| ((11+273.15)*1.8-459.67) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| ((13+273.15)*1.8-459.67) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| ((15+273.15)*1.8-459.67) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| ((17+273.15)*1.8-459.67) | 1-1 }} °F
  • {{convert/4 |40|-|50|-|60|-|70|°F|C|lk=on }} gives: 40–50–60–70 Template:Convert/LonAoffDunitSoffT (Template:Hid{{#invoke:Math|precision_format| (((40+459.67)/1.8)-273.15) | 1-0 }}–Template:Hid{{#invoke:Math|precision_format| (((50+459.67)/1.8)-273.15) | 1-1 }}–Template:Hid{{#invoke:Math|precision_format| (((60+459.67)/1.8)-273.15) | 1-1 }}–Template:Convert/LonAonDoutput onlySoffT)
  • {{convert/4 |45|-|55|rising to|65|-|75|°F|C|lk=out}}     gives: 45–55 rising to 65–75 Template:Convert/LoutAoffDunitSoffT (Template:Hid{{#invoke:Math|precision_format| (((45+459.67)/1.8)-273.15) | 1-0 }}–Template:Hid{{#invoke:Math|precision_format| (((55+459.67)/1.8)-273.15) | 1-1 }} rising to Template:Hid{{#invoke:Math|precision_format| (((65+459.67)/1.8)-273.15) | 1-1 }}–Template:Convert/LoutAonDoutput onlySoffT)
  • {{convert/4 |5+1/2|to|6+1/3|x|7+1/4|x|8+1/5|m|ft}}    gives: 5+12 to 6+13×7+14×8+15 metres (Template:Hid{{#invoke:Math|precision_format| (5+1/2)*1/0.3048 | 1-1 }} to Template:Hid{{#invoke:Math|precision_format| (6+1/3)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (7+1/4)*1/0.3048 | 1-1 }}×Template:Hid{{#invoke:Math|precision_format| (8+1/5)*1/0.3048 | 1-1 }} ft)

The range-words are: to, -, and, or, by, +/-, x, but slash ("/"), comma, or anything is allowed. Display types: disp=comma, disp=semi, disp=or, disp=output only, disp=output number only, disp=x and disp=b. The numeric results are identical to using Template:Convert for each amount individually.

Common problems

Note the name of this template is "convert/4" and omitting the suffix "/4" can cause the error message: "Template loop detected: Template:Convert/x". Be sure to put a range-word (such as "x") between each of the 4 amounts, to avoid error "Convert/4 - Invalid parameter 2".

The 4 amounts, with 3 range-words, are followed by a unit-code (such as "m") as the 8th parameter. The output unit-code can be "0" as the 9th parameter, to allow the default output unit to be triggered.

Retrieved from "https://heald.nga.gov/mediawiki/index.php?title=Template:Convert/4&oldid=450"

History of Early American Landscape Design contributors, "Template:Convert/4," History of Early American Landscape Design, , https://heald.nga.gov/mediawiki/index.php?title=Template:Convert/4&oldid=450 (accessed November 28, 2024).

A Project of the Center for Advanced Study in the Visual Arts

National Gallery of Art, Washington