Pomoč:Convert units

Template {{convert}} is used to convert a value from one unit of measurement to another. This page documents some features of units, and lists units that are commonly used in conversions.

Default output

[uredi | uredi kodo]

If no output unit is specified, the default output for the input unit will be used. Using defaults provides greater uniformity across articles.

Some options provide text that the template may mistakenly use for the output unit, if none is specified. That can be avoided by providing an empty output unit, as shown in the following examples.

  • {{convert|4|ft}} → 4 ft (1,2 m)
  • {{convert|4|ft|adj=mid|-long}} → 4 ft ([convert: neznana enota])
  • {{convert|4|ft||adj=mid|-long}} → 4 ft-long (1,2 m)

The second of the above examples produces an error because "-long" is interpreted as the name of the output unit. The third example avoids that by specifying an empty output unit which means "use the default".

The following also works, although it sets the output precision to 0.

  • {{convert|4|ft|0|adj=mid|-long}} → 4 ft-long (1 m)

The last example works because "|0" sets the output precision to zero, and convert does not look for an output unit once the precision has been specified because a precision is always given after the output unit, if any.

SI prefixes

[uredi | uredi kodo]

The standard SI prefixes can applied to the following units. Predloga:Sidebar metric prefixes

Unit type Unit code Unit name
Area a are
m2 square metre
Charge coulomb coulomb
Energy J joule
Force N newton
Length m metre
Magnetic field strength T tesla
Mass g gram
Power W watt
Pressure Pa pascal
Radioactivity Bq becquerel
Ci curie
Time s second
Volume L litre
l litre
m3 cubic metre

Some SI prefixes are demonstrated in the following. As a convenience, "micro" can be entered as "u" instead of "μ".

  • {{convert|1,23|Gm|angstrom}} → 1,23 Gm (1,23×1019 Å)
  • {{convert|1,23|Mm|angstrom}} → 1,23 Mm (1,23×1016 Å)
  • {{convert|1,23|Ts|hour}} → 1,23 Ts (340.000.000 h)
  • {{convert|1,23|nJ|Wh}} → 1,23 nJ (3,4×10−13 Wh)
  • {{convert|1,23|μm|in}} → 1,23 µm (4,8×10−5 in)
  • {{convert|1,23|um|in}} → 1,23 µm (4,8×10−5 in)
  • {{convert|1,23|um|uin|abbr=on}} → 1,23 µm (48 µin)
  • {{convert|18|mm|in}} → 18 mm (0,71 in)
  • {{convert|18|km|mi}} → 18 km (11 mi)

The above demonstrates that "uin" is the unit code for microinch.

Combinations

[uredi | uredi kodo]

An input unit can be converted to any number of output units—the outputs are specified as a "combination" by separating unit codes with a space (" ") or a plus ("+"). Using a space as a separator does not work if any of the unit codes contains a space.

For example, each of the following converts 1.2 km2 to acres, square yards, and hectares.

  • {{convert|1,2|km2|acre sqyd ha}} → 12 km2 (3.000 akrov; 14.000.000 sq yd; 1.200 ha)
  • {{convert|1,2|km2|acre+sqyd+ha}} → 12 km2 (3.000 akrov; 14.000.000 sq yd; 1.200 ha)

In the following, because "board feet" contains a space, using a space to make a combination fails.

  • {{convert|123|cuyd|m3 board feet}} → 123 cu yd ([convert: neznana enota])
  • {{convert|123|cuyd|m3+board feet}} → 123 cu yd (94 m3; 40.000 board feet)

The following converts a pressure to four output units. The precision is 1 (1 decimal place), and units are abbreviated and linked.

  • {{convert|895|hPa|psi inHg atm mbar|1|abbr=on|lk=on}} → 895 hPa (13,0 psi; 26,4 inHg; 0,9 atm; 895,0 mbar)

It is preferable to use "+" to separate output units when the first unit uses engineering notation; that avoids looking up the unit in Module:Convert/extra.

  • {{convert|1,2|AU|e6km+e6mi|abbr=on}} → 1,2 AU (180×10^6 km; 110×10^6 mi)
  • {{convert|1,2|AU|e6km+e6mi|abbr=unit}} → 1,2 AU (180 milijon km; 110 milijon mi)

Some "standard" combinations have been defined—see the full list of units.

Engineering notation

[uredi | uredi kodo]

Most units can be combined with a scale factor, for example, e6km represents a million kilometres. The following prefixes may be used; per WP:NUMERAL, values follow the short scale. If lk is on, the numbers are linked as shown below.

Engineering notation can only be applied to simple units—temperatures, combinations, and some other special units will not work.

Some examples using engineering notation follow.

  • {{convert|123,4|e3m2}} → 123,4×10^3 m2 (1,328×10^6 sq ft)
  • {{convert|123,4|e3m2|e6sqft|abbr=off}} → 123,4 tisoč kvadratnih metrov (1,328 milijon kvadratnih čevljev)
  • {{convert|1,23|e6L}} → 1,23×10^6 L (320.000 US gal)
  • {{convert|1,23|e6L|e3usgal|abbr=off|lk=on|sp=us}} → 1,23 milijon litrov (320 tisoč ameriških galon)
  • {{convert|1,23|e9impgal}} → 1,23×10^9 imp gal (5,6 Gl)
  • {{convert|1,23|e9impgal|e3usgal|abbr=off|lk=on}} → 1,23 milijarda imperialnih galon (1.480.000 tisoč ameriških galon)
  • {{convert|1,23|e12cuft}} → 1,23×10^12 cu ft (35×10^9 m3)

Units

[uredi | uredi kodo]

Area

Examples:

  • {{convert|1.5|sqmi|km2}} → 15 sq mi (39 km2)
  • {{convert|1.5|sqmi|km2|abbr=off}} → 15 square mile (39 kvadratnih kilometrov)
  • {{convert|1.5|sqmi|km2|abbr=on}} → 15 sq mi (39 km2)
Unit code Unit symbol Unit name US name, if different
acre aker aker
ha ha hektar
m2 m2 kvadratni meter
cm2 cm2 kvadratni centimeter
km2 km2 kvadratni kilometer
sqin sq in square inch
sqft sq ft kvadratni čevelj
sqyd sq yd square yard
sqmi sq mi square mile

Fuel efficiency

Examples:

  • {{convert|12|mpgus|km/L}} → 12 mpg-US (5,1 km/L)
  • {{convert|12|mpgus|km/L|abbr=off}} → 12 milj na ameriška galona (5,1 kilometri na liter)
  • {{convert|12|mpgus|km/L|abbr=off|sp=us}} → 12 milj na ameriška galona (5,1 kilometri na liter)
  • {{convert|12|mpgus|km/L|abbr=on}} → 12 mpg-US (5,1 km/L)
Unit code Unit symbol Unit name US name, if different
km/L km/L kilometer na liter
mpgimp mpg-imp milja na imperial gallon
mpgus mpg-US milja na ameriška galona
L/km L/km liter na kilometer
L/100 km L/100 km liter na 100 kilometer

Length

Examples:

  • {{convert|123|cm|in}} → 123 cm (48 in)
  • {{convert|123|cm|in|abbr=off|sp=us}} → 123 centimetrov (48 palcev)
  • {{convert|123|cm|in|abbr=on}} → 123 cm (48 in)
Unit code Unit symbol Unit name US name, if different
uin µin microinch
in in palec
ft ft čevelj
yd yd yard
mi mi milja
nmi nmi morska milja
m m meter
cm cm centimeter
mm mm milimeter
km km kilometer
angstrom Å ångström

Mass

Examples:

  • {{convert|72.3|kg|lb}} → 723 kg (1.594 lb)
  • {{convert|72.3|kg|lb|abbr=off}} → 723 kilogramov (1.594 funtov)
  • {{convert|72.3|kg|lb|abbr=on}} → 723 kg (1.594 lb)
Unit code Unit symbol Unit name US name, if different
g g gram
kg kg kilogram
oz oz unča
lb lb funt
st st stone
LT angleška tona angleška tona
MT t metric ton
ST ameriška tona ameriška tona

Pressure

Examples:

  • {{convert|28|psi|Pa}} → 28 psi (190.000 Pa)
  • {{convert|28|psi|Pa|abbr=off}} → 28 pounds per square inch (190.000 pascal)
  • {{convert|28|psi|Pa|abbr=on}} → 28 psi (190.000 Pa)
Unit code Unit symbol Unit name US name, if different
atm atm standard atmosphere
mbar mbar millibar
psi psi pound per square inch
Pa Pa pascal

Speed

Examples:

  • {{convert|60|mph|km/h}} → 60 mph (97 km/h)
  • {{convert|60|mph|km/h|abbr=off}} → 60 milj na uro (97 kilometrov na uro)
  • {{convert|60|mph|km/h|abbr=on}} → 60 mph (97 km/h)
Unit code Unit symbol Unit name US name, if different
km/h km/h kilometer na uro
km/s km/s kilometre per second
kn kn vozel
mph mph milja na uro

Temperature

Examples:

  • {{convert|100|C|F}} → 100 °C (212 °F)
  • {{convert|100|C|F|abbr=off}} → 100 degrees Celsius (212 degrees Fahrenheit)
  • {{convert|100|C-change|F-change}} → 100 °C (180 °F)
  • {{convert|100|C-change|F-change|abbr=out}} → 100 degrees Celsius change (180 °F)
Unit code Unit symbol Unit name US name, if different
C °C degree Celsius
F °F degree Fahrenheit
K K kelvin
C-change °C degree Celsius change
F-change °F degree Fahrenheit change
K-change K kelvin change

Torque

Examples:

  • {{convert|12.5|Nm|lb.in}} → 125 N·m (1.110 lb·in)
  • {{convert|12.5|Nm|lb.in|abbr=off}} → 125 newton metre (1.110 pound force-inch)
  • {{convert|12.5|Nm|lb.in|abbr=on|lk=on}} → 125 N·m (1.110 lb·in)
Unit code Unit symbol Unit name US name, if different
lb.in lb·in pound force-inch
lb.ft lb·ft pound force-foot
Nm N·m newton metre

Volume

Examples:

  • {{convert|125|cuin|l}} → 125 cu in (2,05 L)
  • {{convert|125|cuin|l|abbr=off}} → 125 cubic inches (2,05 litre)
  • {{convert|125|cuin|l|abbr=on}} → 125 cu in (2,05 L)
Unit code Unit symbol Unit name US name, if different
cuin cu in cubic inch
cuft cu ft kubični čevelj
cuyd cu yd cubic yard
cumi cu mi cubic mile
impgal imp gal imperial gallon
impoz imp fl oz imperial fluid ounce
usgal US gal ameriška galona
usoz US fl oz US fluid ounce
L L liter
l L liter
m3 m3 kubični #meter
cc cc cubic centimetre
mm3 mm3 cubic millimetre


Hands (unit of length)

[uredi | uredi kodo]

A hand is a unit of length used to measure the height of horses. One hand is four inches, and a value of 12.3 hands represents 12 hands + 3 inches (51 inches).

Output name

[uredi | uredi kodo]
  • By default, the unit is shown as a linked name (hands).
  • The hands unit can be abbreviated to "h" or to "hh"; by default, abbreviations are not linked.
    {{convert|27|in|hand}} → 27 in (6,3 h)
    {{convert|27|in|hand|lk=off}} → 27 in (6,3 h)
    {{convert|27|in|hand|abbr=h}} → 27 in (6,3 h)
    {{convert|27|in|hand|abbr=hh}} → 27 in (6,3 hh)
    {{convert|27|in|hand|abbr=hh|lk=out}} → 27 in (6,3 hh)

Output value

[uredi | uredi kodo]
  • The hands value has at most one digit after the decimal mark, and has an optional fraction.
  • A precision of 2 assumes |frac=2 (round to nearest 12 inch).
  • A precision of 3 or more assumes |frac=4 (round to nearest 14 inch).
  • If ever needed, |frac=8 can be used to round to the nearest 18 inch.
    {{convert|27,63|in|hand}} → 27,63 in (7,0 h)
    {{convert|27,63|in|hand|0}} → 27,63 in (7 h)
    {{convert|27,63|in|hand|1}} → 27,63 in (7,0 h)
    {{convert|27,63|in|hand|2}}27,63 in (6,3+12 h)
    {{convert|27,63|in|hand|3}}27,63 in (6,3+34 h)
    {{convert|27,63|in|hand|frac=8}}27,63 in (6,3+58 h)
    {{convert|28,5|in|hand|2}}28,5 in (7,0+12 h)
    {{convert|28,5|in|hand|3}}28,5 in (7,0+12 h)

Output in hands and inches

[uredi | uredi kodo]
  • When using "hand in" to convert to hands and inches, the rounded hands and inches values are equivalent, and use the same fraction, if any.
  • Special rounding of the inches value only occurs when "hand in" is the output. For example, if the output is "in hand", the inches value is rounded independently from the hands value.
    {{convert|156|cm|hand in}} → 156 cm (15,1 h; 61 in)
    {{convert|156|cm|hand in|2}}156 cm (15,1+12 h; 61+12 in)
    {{convert|156|cm|in hand}} → 156 cm (61 in; 15,1 h)
    {{convert|156|cm|in hand|2}}156 cm (61,42 in; 15,1+12 h)
    {{convert|156|cm|hand in|abbr=out}} → 156 centimetrov (15,1 h; 61 in)
    {{convert|156|cm|hand in|abbr=h}} → 156 cm (15,1 h; 61 in)
    {{convert|156|cm|hand in|abbr=hh}} → 156 cm (15,1 hh; 61 in)

Ranges

[uredi | uredi kodo]
  • A range of values can be indicated with "-" (hyphen) or "to". When a dash is displayed by convert, it is always an en dash.
  • Alternatively, "and" and "or" can be used.
    {{convert|137|-|156|cm|hand in}} → 137–156 cm (13,2–15,1 h; 54–61 in)
    {{convert|137|-|156|cm|hand in|2}}137–156 cm (13,2–15,1+12 h; 54–61+12 in)
    {{convert|137|-|156|cm|hand in|abbr=in}} → 137–156 cm (13,2–15,1 hand; 54–61 palcev)
    {{convert|137|-|156|cm|hand in|abbr=h}} → 137–156 cm (13,2–15,1 h; 54–61 in)
    {{convert|137|-|156|cm|hand in|abbr=on}} → 137–156 cm (13,2–15,1 h; 54–61 in)
    {{convert|137|and|156|cm|hand in|abbr=on}} → 137 in 156 cm (13,2 in 15,1 h; 54 in 61 in)
    {{convert|137|or|156|cm|hand in|abbr=on}} → 137 ali 156 cm (13,2 ali 15,1 h; 54 ali 61 in)

Examples

[uredi | uredi kodo]
  • The following examples illustrate various combinations of options.
    {{convert|57|in|hand}} → 57 in (14,1 h)
    {{convert|2|m|hand}} → 2 m (19,3 h)
    {{convert|137|cm|hand|2}} → 137 cm (13,2 h)
    {{convert|137|cm|hand|2|sp=us}} → 137 cm (13,2 h)
    {{convert|14,1|hand|in}} → 14,1 h (57 in)
    {{convert|14,1|hand|cm}} → 14,1 h (145 cm)
    {{convert|14,1|hand|in cm}} → 14,1 h (57 in; 145 cm)
    {{convert|14,1|hand|cm in}} → 14,1 h (145 cm; 57 in)
    {{convert|14,1|-|14,3|hand|cm}} → 14,1–14,3 h (145–150 cm)
    {{convert|14,1|-|14,3|hand|in cm}} → 14,1–14,3 h (57–59 in; 145–150 cm)
    {{convert|50|-|57|in|hand}} → 50–57 in (12,2–14,1 h)
    {{convert|2|-|3|m|hand}} → 2–3 m (19,3–29,2 h)
    {{convert|57|or|59|in|hand|abbr=on}} → 57 ali 59 in (14,1 ali 14,3 h)
    {{convert|137|-|139|cm|hand|lk=on}} → 137–139 cm (13,2–13,3 h)
    {{convert|137|and|162|cm|hand|0|abbr=in|lk=in}} → 137 in 162 cm (13 in 16 hand)
    {{convert|137|and|162|cm|hand in}} → 137 in 162 cm (13,2 in 16,0 h; 54 in 64 in)
    {{convert|9,2|hand}} → 9,2 h (38 in; 97 cm)
    {{convert|9,2|hand|lk=off}} → 9,2 h (38 in; 97 cm)
    {{convert|9,2|hand|abbr=h}} → 9,2 h (38 in; 97 cm)
    {{convert|9,2|hand|abbr=h|lk=in}} → 9,2 h (38 in; 97 cm)
    {{convert|9,2|hand|abbr=hh|lk=in}} → 9,2 hh (38 in; 97 cm)
    {{convert|9,2+1/2|hand}}9,2+12 h (38,5 in; 98 cm)
    {{convert|9,2+3/4|hand}}9,2+34 h (38,75 in; 98 cm)
    {{convert|9,2+3/4|hand|abbr=h}}9,2+34 h (38,75 in; 98 cm)
    {{convert|9,2+3/4|hand|cm in}}9,2+34 h (98 cm; 38,75 in)
    {{convert|9,2+3/4|hand|cm in|abbr=out}}9,2+34 hand (98 cm; 38,75 in)
    {{convert|9,2+3/4|hand|cm in|abbr=on}}9,2+34 h (98 cm; 38,75 in)
    {{convert|9,2+3/4|hand|in}}9,2+34 h (38,75 in)
    {{convert|9,2+3/4|hand|in|abbr=out}}9,2+34 hand (38,75 in)
    {{convert|9,2+3/4|hand|in|abbr=on}}9,2+34 h (38,75 in)
    {{convert|15,1|-|16,3|hand}} → 15,1–16,3 h (61–67 in; 155–170 cm)
    {{convert|14,2|to|16,1|hand}} → 14,2 do 16,1 h (58 do 65 in; 147 do 165 cm)