Skabelon:Height

Fra Wikipedia, den frie encyklopædi


Documentation icon Skabelondokumentation[vis] [redigér] [historik] [opfrisk]
Denne skabelon indeholder en eller flere valgbare parametre.
Skabelonen anvender en syntaks, som er yderst kompliceret og esoterisk. Forsøg ikke at ændre den, medmindre du er helt sikker på, at du forstår opbygningen og er indstillet på at udbedre alle eventuelle uheldige følger af, at ændringer giver et uventet resultat. Alle eksperimenter bør udføres i sandkassen, sandkasse-skabelonen, eller på din egen brugerside.

Pas på med decimaltal[rediger kildetekst]

Skabelonen er oprettet som en kopi af den tilsvarende skabelon på engelsk wikipedia. Man skal være opmærksom på at decimaltal på dansk skal anvende komma, ikke punktum. Skriv altså "1,72" i stedet for "1.72".

Sakbelonen anvender skabelon:Convert som underskabelon til at konvertere mellem forskellige enheder. Sider hvor tallet i skabelonkaldet har tvetydig brug af komma og punktum bliver placeret i Kategori:Sider med fejl eller advarsel ved enhedskonvertering,

Instructions[rediger kildetekst]

  • The template is intended for conversion of heights specified in either feet and inches, or metric units (centimetres or metres). Metric units are converted to feet and inches, and feet and inches are converted to meters.
  • As this template is intended for use in infoboxes, the units on both sides of the conversion are abbreviated by default. When using this template outside of infoboxes, use the abbr parameter, which can take values of yes (default; both sides of the conversion are abbreviated), no (both sides of the conversion are spelled out), or mos (WP:MOSNUM-compliant format, where the units being converted are spelled out and the units of the converted values are abbreviated).
  • For conversion of metric units to feet/inches, the frac parameter can be specified to either show the output inches as decimals (frac=10) or as a vulgar fraction (frac=desired denominator; the default is 2 for halves). The frac parameter is ignored for conversion of feet/inches to meters.
  • When decimal output is used, the default precision is 1 for meters-to-feet/inches conversion and 2 for feet/inches-to-meters conversion, but it can be overridden by specifying a different figure using the precision parameter (see example below). The precision parameter is ignored when frac is set to anything but 10.
  • wiki parameter specifies whether the names of the units should be wikified or not and can take values of either yes or no. The default value is no.

Code[rediger kildetekst]

Code Result
{{height|m=1,77|precision=0}} 2 m
{{height|cm=177|precision=0}} 177 cm
{{height|cm=177|frac=16}} 177 cm
{{height|ft=6}} 1,83 m
{{height|ft=6|in=1}} 1,85 m
{{height|ft=6|in=1|precision=1}} 1,9 m
{{height|ft=5|in=7+1/2}} 1,71 m
{{height|ft=5|in=7+1/2|precision=1}} 1,7 m
{{height|in=10}} 0,25 m
{{height|ft=6|in=2|abbr=mos}} 1,88 m
{{height|ft=6|in=2}} 1,88 m
{{height|ft=5|in=7+1/2|precision=3}} 1,715 m
{{height|cm=200|in=2|precision=0}} Fejl: brug venligst kun en type enheder for højden
  • m is for meters
  • cm is for centimetres
  • ft is for feet
  • in is for inches

Template data[rediger kildetekst]

Dette er denne skabelons TemplateData-dokumentation, som bruges af VisualEditor og andre værktøjer.

Height

The template is intended for conversion of heights specified in either meters or in feet and inches.

Skabelonparametre[Rediger TemplateData]

ParameterBeskrivelseTypeStatus
Metersm meter meters metre metres

The height in meters. Do not use if feet and inches are specified.

Talvalgfri
Centimeterscm centimeter centimeters centimetre centimetres

The height in centimeters. Do not use if feet and inches are specified.

Talvalgfri
Feetft foot feet

The feet part of the height in feet and inches. Do not use if centimeters are specified.

Talvalgfri
Inchesin inch inches

The inches part of the height in feet and inches (optional). Do not use if centimeters are specified. Fractions are supported in the form u+n/d.

Talvalgfri
Precision of converted valueprecision

The amount of decimal places to display the converted value to. Defaults to 2 for feet and inches to meters and to 1 for meters/centimeters to feet and inches.

Talvalgfri
Fraction denominatorfrac

Shows result as a fraction. The number in this parameter is the denominator of the fraction. Used only for meters/centimeters to feet and inches. Set to "10" for decimals. Defaults to 2 (halves).

Talvalgfri
Abbreviation styleabbr

Changes abbreviation style. Set to "yes" for all units to be abbreviated (default), "no" for all to be spelled out, or "mos" for the units being converted to be spelled out and the converted units to be abbreviated.

Strengvalgfri
Unit linkingwiki

Changes whether units are linked. Set to "no" to not link units (default) or "yes" to link units.

Strengvalgfri

Se også[rediger kildetekst]

  • {{convert}}
    • {{convert|1.82|m|ftin|frac=4|abbr=on}} → 1,82 m (5 ft 11 34 in)*
    • {{convert|182|cm|ftin|frac=4|abbr=on}} → 182 cm (5 ft 11 34 in)
    • {{convert|5|ft|11+3/4|in|m|2|abbr=on}} → 5 ft 11 34 in (1,82 m)
    • {{convert|5|ft|11+3/4|in|cm|0|abbr=on}} → 5 ft 11 34 in (182 cm)