This page is protected against editing.

Template:Size

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Size/doc.

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 then measurements will be shown in both centimeters and inches, if user language is German than only metric units will be shown. This template is mainly used in the "Dimensions" field of an {{Artwork}} template.

Usage

{{Size |unit= |height= |width= }}

Template parameters

ParameterDescriptionDefaultStatus
unit
1
Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi).cmrequired
heightheight (with word "height" displayed)emptyoptional
widthwidth (with word "width" displayed)emptyoptional
lengthlength (with word "length" displayed)emptyoptional
depthdepth (with word "depth" displayed)emptyoptional
diameterdiameter (with word "diameter" displayed)emptyoptional
thicknessthickness (with word "thickness" displayed)emptyoptional
precConversion precision (optional number of decimal digits).1 (2 for mm to inches)optional
langlanguage code (only needs to be provided if the language shall be fixed and independant from the user's preferences)value of {{int:Lang}}optional
1Alternative name for "unit". Unit of input (must be one of: cm, m, mm, km, in, ft, yd, mi). Deprecated.cmdeprecated
2First dimension measured. Deprecated.emptydeprecated
3A second dimension measured. Deprecated.emptydeprecated
4A third dimension measured. Deprecated.emptydeprecated

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:
Module:Size

See also

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 unit translations are in Module:I18n/units.

Examples

Code Output Notes
{{Size|unit=m|height=10|width=20}} height: 10 m (10.9 yd); width: 20 m (21.8 yd)
dimensions QS:P2048,10U11573
dimensions QS:P2049,20U11573
Use of name parameters
{{Size|unit=mi|width=10|height=20|depth=30}} height: 20 mi (32.1 km); width: 10 mi (16 km); depth: 30 mi (48.2 km)
dimensions QS:P2048,20U253276
dimensions QS:P2049,10U253276
dimensions QS:P5524,30U253276
Use of name parameters
{{Size|cm|12.1234|98.1234|prec=1}} 12.1 × 98.1 cm (4.7 × 38.6 in) Use of "prec" parameter
{{Size|in|12.12|98.12|lang=fr}} 12,1 × 98,1 pouces (30,7 × 249,2 cm) Use of "lang" parameter
{{Size|cm|123}} 123 cm (48.4 in) 1D version
{{Size|in|123|456}} 123 × 456 in (312.4 × 1,158.2 cm) 2D version
{{Size|ft|123|456|789}} 123 × 456 × 789 ft (37.4 × 138.9 × 240.4 m) 3D version