Template:Size/doc: Difference between revisions
More actions
+ thickness |
No edit summary |
||
| Line 1: | Line 1: | ||
{{TemplateBox | {{TemplateBox | ||
|1= | |1=unit | ||
|1d=Alternative name: " | |1d=Alternative name: "1". Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi). | ||
|1def=cm | |1def=cm | ||
|1stat=required | |1stat=required | ||
|2= | |||
|2d= | |2=height | ||
|2d=height (with word "height" displayed) | |||
|2def= | |2def= | ||
|2stat= | |2stat=optional | ||
|3= | |||
|3d= | |3=width | ||
|3d=width (with word "width" displayed) | |||
|3def= | |3def= | ||
|3stat=optional | |3stat=optional | ||
|4= | |||
|4d= | |4=length | ||
|4d=length (with word "length" displayed) | |||
|4def= | |4def= | ||
|4stat=optional | |4stat=optional- | ||
|5= | |||
|5d= | |5=depth | ||
|5d=depth (with word "depth" displayed) | |||
|5def= | |5def= | ||
|5stat=optional | |5stat=optional- | ||
|6= | |||
|6d= | |6=diameter | ||
|6d=diameter (with word "diameter" displayed) | |||
|6def= | |6def= | ||
|6stat=optional | |6stat=optional- | ||
|7= | |||
|7d= | |7=thickness | ||
|7d=thickness (with word "thickness" displayed) | |||
|7def= | |7def= | ||
|7stat=optional | |7stat=optional- | ||
|8= | |||
|8d= | |8=prec | ||
|8def= | |8d=Conversion precision (optional number of decimal digits). | ||
|8stat=optional | |8def=1 (2 for mm to inches) | ||
|9= | |8stat=optional- | ||
|9d= | |||
|9def= | |9=lang | ||
|9stat=optional | |9d=language code (only needs to be provided if the language shall be fixed and independant from the user's preferences) | ||
| | |9def=value of <nowiki>{{int:Lang}}</nowiki> | ||
| | |9stat=optional- | ||
| | |||
|11stat=optional | |11=1 | ||
| | |11d=Alternative name for "unit". Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi). <span style="color:red">Depreciated.</span> | ||
| | |11def=cm | ||
| | |11stat=optional- | ||
| | |||
| | |12=2 | ||
| | |12d=First dimension measured. <span style="color:red">Depreciated.</span> | ||
| | |12def= | ||
| | |12stat=optional- | ||
|13=3 | |||
|13d=A second dimension measured. <span style="color:red">Depreciated.</span> | |||
|13def= | |||
|13stat=optional- | |||
|14=4 | |||
|14d=A third dimension measured. <span style="color:red">Depreciated.</span> | |||
|14def= | |||
|14stat=optional- | |||
|name=Size | |name=Size | ||
|desc=Displays a 1D (length), 2D (width × height) or 3D (width × height × depth) size, formatted according to localized format. For example if user language is English than measurements will be shown in both centimeters and inches, if user language is German than only metric units will be shown. Template mostly used in the "Dimensions" field of a {{m|Artwork}} template. | |desc=Displays a 1D (length), 2D (width × height) or 3D (width × height × depth) size, formatted according to localized format. For example if user language is English than measurements will be shown in both centimeters and inches, if user language is German than only metric units will be shown. Template mostly used in the "Dimensions" field of a {{m|Artwork}} template. | ||
| Line 73: | Line 90: | ||
! Output | ! Output | ||
! Notes | ! Notes | ||
|- | |- | ||
| <nowiki>{{Size|unit=m|height=10|width=20}}</nowiki> | | <nowiki>{{Size|unit=m|height=10|width=20}}</nowiki> | ||
| Line 101: | Line 106: | ||
| {{Size|in|12.12|98.12|lang=fr}} | | {{Size|in|12.12|98.12|lang=fr}} | ||
| Use of "lang" parameter | | Use of "lang" parameter | ||
|- | |||
| <nowiki>{{Size|cm|123}}</nowiki> | |||
| {{Size|cm|123}} | |||
| 1D version | |||
|- | |||
| <nowiki>{{Size|in|123|456}}</nowiki> | |||
| {{Size|in|123|456}} | |||
| 2D version | |||
|- | |||
| <nowiki>{{Size|ft|123|456|789}}</nowiki> | |||
| {{Size|ft|123|456|789}} | |||
| 3D version | |||
|- | |- | ||
|} | |} | ||
Revision as of 03:21, 29 July 2013
Displays a 1D (length), 2D (width × height) or 3D (width × height × depth) size, formatted according to localized format. For example if user language is English than measurements will be shown in both centimeters and inches, if user language is German than only metric units will be shown. Template mostly used in the "Dimensions" field of a Artwork template.
Usage
{{Size |unit= |height= |width= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
unit | Alternative name: "1". Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi). | cm | required | |
height | height (with word "height" displayed) | empty | optional | |
width | width (with word "width" displayed) | empty | optional | |
length | length (with word "length" displayed) | empty | optional | |
depth | depth (with word "depth" displayed) | empty | optional | |
diameter | diameter (with word "diameter" displayed) | empty | optional | |
thickness | thickness (with word "thickness" displayed) | empty | optional | |
prec | Conversion precision (optional number of decimal digits). | 1 (2 for mm to inches) | optional | |
lang | language code (only needs to be provided if the language shall be fixed and independant from the user's preferences) | value of {{int:Lang}} | optional | |
1 | Alternative name for "unit". Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi). Depreciated. | cm | optional | |
2 | First dimension measured. Depreciated. | empty | optional | |
3 | A second dimension measured. Depreciated. | empty | optional | |
4 | A third dimension measured. Depreciated. | empty | optional | |
Additional information
The template is intended to be used in the following namespaces: the File namespace
The template is intended to be used by the following user groups: no user group specified
Relies on:
{{Formatnum}}
Localization
To add your language to the list of languages supported by this template, please edit the template and add a row to the "{{LangSwitch|}}" construct. It takes the form "|xx= Your translation " (xx being the code of your language)
All translations are in subpage {{Size/label}}.
Examples
| Code | Output | Notes |
|---|---|---|
| {{Size|unit=m|height=10|width=20}} | Height: 10 m (10.9 yd); Width: 20 m (21.9 yd) | Use of name parameters |
| {{Size|unit=mi|width=10|height=20|depth=30}} | Height: 20 miles (32.2 km); Width: 10 miles (16.1 km); Depth: 30 miles (48.3 km) | Use of name parameters |
| {{Size|cm|12.1234|98.1234|prec=1}} | 12.1 cm (4.8 in) × 98.1 cm (38.6 in) | Use of "prec" parameter |
| {{Size|in|12.12|98.12|lang=fr}} | 12.1 pouces (30.8 cm) × 98.1 pouces (249.2 cm) | Use of "lang" parameter |
| {{Size|cm|123}} | 123 cm (48.4 in) | 1D version |
| {{Size|in|123|456}} | 123 in (312.4 cm) × 456 in (11.6 m) | 2D version |
| {{Size|ft|123|456|789}} | 123 ft (37.5 m) × 456 ft (139 m) × 789 ft (240.5 m) | 3D version |