Difference between revisions of "Template:BScvt"
Jump to navigation
Jump to search
imported>Jc86035 m |
imported>Jc86035 m |
||
| Line 1: | Line 1: | ||
| − | <includeonly>{| cellspacing="0" cellpadding="0" style="font-size:80%; text-align:{{{align|right}}}; float:{{{align|right}}} color:inherit; background-color:transparent; margin-top:- | + | <includeonly>{| cellspacing="0" cellpadding="0" style="font-size:80%; text-align:{{{align|right}}}; float:{{{align|right}}} color:inherit; background-color:transparent; margin-top:-2px; margin-bottom:-2px; display:inline-table;vertical-align:bottom;" |
| − | | style="line-height:0.9em; text-align:inherit;" | {{{1}}} {{#switch: {{{in}}} | + | | style="line-height:0.9em; padding:0; text-align:inherit;" | {{{1}}} {{#switch: {{{in}}} |
| ch={{#if:{{{2|}}}|m |ch }} | | ch={{#if:{{{2|}}}|m |ch }} | ||
| m={{#if:{{{2|}}}|yd |m }} | | m={{#if:{{{2|}}}|yd |m }} | ||
| Line 8: | Line 8: | ||
}} | }} | ||
|- | |- | ||
| − | | style="line-height:0.9em; font-style:{{{alt|normal}}}; text-align:inherit; {{#if:{{{line|}}}|border-top:1px solid gray; line-height:125%;|}}" | {{#if:{{{2|}}}|{{#expr:{{{1}}}*{{#switch: {{{in}}} | + | | style="line-height:0.9em; padding:0; font-style:{{{alt|normal}}}; text-align:inherit; {{#if:{{{line|}}}|border-top:1px solid gray; line-height:125%;|}}" | {{#if:{{{2|}}}|{{#expr:{{{1}}}*{{#switch: {{{in}}} |
| ch=0.04971 | | ch=0.04971 | ||
| m=0.9144 | | m=0.9144 | ||
Revision as of 09:55, 21 June 2016
| This template uses Lua: |
Contents
Usage
This template is a simplified version of {{Convert}}. It displays a distance as two lines of text. The template takes the input (in Imperial units) and calculates the metric equivalent.
- Inserting the optional second parameter (any character) reverses the units.
- Decimal values are supported.
- The template automatically adds the units after the values.
The text is right-aligned, but can be changed to left- by applying the parameter "align=left".
The alternate units can be changed to italic by applying the parameter "alt=italic".
A dividing line can be added by applying the parameter “|line=anything ”.
Units
The default units are miles for input and kilometres as output.
- Adding the named parameter
|in=(for input) will allow alternate input units:
in=Units Converts to mi;ch miles; chains kilometres yd yards metres ft feet ch chains m metres yards
- Whitespace for
mi;ch(in both the distance and the units) is allowed but not necessary.
Examples
| Result | Input | ||
|---|---|---|---|
|
{{BScvt|0}}
| ||
|
{{BScvt|1.50|x}}
| ||
|
{{BScvt|16.3|align=left}}
| ||
|
{{BScvt|100.0|alt=italic}}
| ||
|
{{BScvt|150|line=-}}
| ||
|
{{BScvt|56; 12|in=mi; ch}}
| ||
|
{{BScvt|125|in=yd}}
| ||
|
{{BScvt|150|in=m}}
| ||
|
{{BScvt|50|in=ch}}
| ||
|
{{BScvt|250|in=ch|x}}
|
See also
| The above documentation is transcluded from Template:BScvt/doc. (edit | history) Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. Please add categories to the /doc subpage. Subpages of this template. |