Predloga:Infopolje Oseba/višina

Iz Wikipedije, proste enciklopedije
Dokumentacija za predlogo[poglej] [uredi] [zgodovina] [osveži]

Predloga:Infopolje Oseba is one of three templates used to automatically add conversions of height measurements displayed by Predloga:Infopolje Oseba and other infoboxes with a |height= parameter.

  1. Predloga:Infopolje Oseba/višina changes text for units of height to the abbreviations "m", "cm", "ft", or "in", then passes the string to:
  2. Predloga:Infopolje Oseba/višina/locate which replaces any instances of   with a space, and determines the positions of "m", "cm", "ft", or "in" within that string, all of which is passed to:
  3. Predloga:Infopolje Oseba/višina/switch which does the conversion

Uporaba[uredi kodo]

Meter:

  • {{Infopolje Oseba/višina|1 metre}} → 1 m
  • {{Infopolje Oseba/višina|1 meter}} → 1 m
  • {{Infopolje Oseba/višina|1,57 metres}} → 1,57 m
  • {{Infopolje Oseba/višina|1,57 meters}} → 1,57 m
  • {{Infopolje Oseba/višina|1,57 m}} → 1,57 m
  • {{Infopolje Oseba/višina|1,57 ms}} → 1,57 m

Centimeter:

  • {{Infopolje Oseba/višina|1 centimetre}} → 1 cm
  • {{Infopolje Oseba/višina|1 centimeter}} → 1 cm
  • {{Infopolje Oseba/višina|157 centimetres}} → 157 cm
  • {{Infopolje Oseba/višina|157 centimeters}} → 157 cm
  • {{Infopolje Oseba/višina|157 cm}} → 157 cm
  • {{Infopolje Oseba/višina|157 cms}} → 157 cm

Čevelj:

  • {{Infopolje Oseba/višina|1 foot}} → 30 cm
  • {{Infopolje Oseba/višina|2 feet}} → 61 cm
  • {{Infopolje Oseba/višina|2 ft}} → 61 cm

Inč:

  • {{Infopolje Oseba/višina|1 inch}} → 3 cm
  • {{Infopolje Oseba/višina|2 inches}} → 5 cm
  • {{Infopolje Oseba/višina|2 in}} → 5 cm
  • {{Infopolje Oseba/višina|2 ins}} → 5 cm

Čevlji in inči, ki vključujejo neprekinljiv presledek, in tekst za višino:

  • {{Infopolje Oseba/višina|5 feet 2 inches}} → 157 cm
  • {{Infopolje Oseba/višina|5feet 2inches}} → 157 cm
  • {{Infopolje Oseba/višina|5 feet 2 inches}} → 157 cm
  • {{Infopolje Oseba/višina|5 feet 2 inches (2012)}} → 157 cm (2012)

Vključeni so sklici na koncu besedila:

  • {{Infopolje Oseba/višina|5 feet 2 inches (2012)<ref>citation goes here</ref>}} → 157 cm (2012)[1]
  • {{Infopolje Oseba/višina|5 feet 2 inches (2012)<ref>"title". ''work''.</ref>}} → 157 cm (2012)[2]
  • {{Infopolje Oseba/višina|5 feet 2 inches (2012)<ref>{{cite news|title=feet|work=inches}}</ref>}} → 157 cm (2012)[3]
  • {{Infopolje Oseba/višina|5 feet 2 inches (2012)<ref>{{citation|title=metres|work=centimetres}}</ref>}} → 157 cm (2012)[4]
  1. citation goes here
  2. "title". work.
  3. »feet«. inches.
  4. »metres«, centimetres

{{Convert}} templates generating wikilinked unit names:

  • {{Infopolje Oseba/višina|{{Convert|5|ft|2|in|lk=on|abbr=on}}}} → 5 ftin (1,57 m)
  • {{Infopolje Oseba/višina|{{Convert|5|ft|2|in|lk=on|abbr=off}}}} → 5 čevljevpalca (1,57 metra)
  • {{Infopolje Oseba/višina|{{Convert|1,57|m|lk=on|abbr=on}}}} → 1,57 m (5 ftin)
  • {{Infopolje Oseba/višina|{{Convert|1,57|m|lk=on|abbr=off}}}} → 1,57 metra (5 čevljevpalca)
  • {{Infopolje Oseba/višina|{{Convert|157|cm|ftin|lk=on|abbr=on}}}} → 157 cm (5 ftin)
  • {{Infopolje Oseba/višina|{{Convert|157|cm|ftin|lk=on|abbr=off}}}} → 157 cmetrov (5 čevljevpalca)

Exceptions[uredi kodo]

Does not replace numbers in hard-coded conversions, but does replace unit names with abbreviations (examples intentionally show incorrect conversions):

  • {{Infopolje Oseba/višina|5 feet 2 inches (1.00 metres)}} → 5 ft 2 in (1.00 m)
  • {{Infopolje Oseba/višina|157 centimetres (5 feet 5 inches)}} → 157 cm (5 ft 5 in)

Does not replace numeric output of conversion templates such as {{convert}} or {{height}}, but does replace unit names with abbreviations (examples have different precision than usual):

  • {{Infopolje Oseba/višina|{{Convert|5|ft|2|in|m|3|abbr=off}}}} → 5 čevljev 2 palca (1,575 metra)
    • output of convert template: 5 čevljev 2 palca (1,575 metra)
  • {{Infopolje Oseba/višina|{{Convert|1.57|m|ftin|1|abbr=off}}}} → 157 metrov (515 čevljev 1,1 palca)
    • output of convert template: 157 metrov (515 čevljev 1,1 palca)
  • {{Infopolje Oseba/višina|{{Height|ft=5|in=2|precision=3|abbr=no}}}} → 5 ft 2 in (1,575 m)
    • output of convert template: 5 feet 2 inches (1,575 meters)
  • {{Infopolje Oseba/višina|{{Height|m=1.57|frac=4|abbr=no}}}} → 1,57 m (5 ft 1+Napaka v izrazu: Nepričakovan operator <.Napaka v izrazu: Nepričakovan operator <. in)
    • output of convert template: 1,57 meters (5 feet 1+Napaka v izrazu: Nepričakovan operator <.Napaka v izrazu: Nepričakovan operator <. inches)

Period at end of abbreviation displays after the conversion:

  • {{Infopolje Oseba/višina|5 m.}} → 5 m.
  • {{Infopolje Oseba/višina|5 ft.}} → 152 cm.

Multiple unit conversions won't work if input contains periods or commas:

  • {{Infopolje Oseba/višina|5 ft. 2 in}} → 5 ft. 2 in
  • {{Infopolje Oseba/višina|5 ft, 2 in}} → 5 ft, 2 in

Does not recognize symbols for feet and inches:

  • {{Infopolje Oseba/višina|5' 2"}} → 5' 2"
  • {{Infopolje Oseba/višina|5′ 2″}} → 5′ 2″
  • {{Infopolje Oseba/višina|157cm (5' 2")}} → 157 cm (5' 2")
  • {{Infopolje Oseba/višina|157cm (5′ 2″)}} → 157 cm (5′ 2″)

See also[uredi kodo]