UnitConvert

UnitConvert[quantity,targetunit]

attempts to convert the specified quantity to the specified targetunit.

UnitConvert[quantity]

converts the specified quantity to its "SIBase" units.

Details

  • The targetunit can be a canonical unit or a Quantity expression.
  • When targetunit is a Quantity, the resulting output will have the same unit as targetunit.
  • A targetunit specification can also be one of the following unit systems: "SIBase", "SI", "Imperial", or "Metric".
  • UnitConvert accepts TimeSeries, EventSeries, and TemporalData inputs and attempts to convert Quantity values to the specified targetunit.
  • UnitConvert accepts Association inputs and attempts to convert Quantity values to the specified targetunit.
  • An internet connection is required for conversion between currency units.

Examples

open allclose all

Basic Examples  (2)

Convert from miles to kilometers:

In[1]:=
Click for copyable input
Out[1]=

Convert a Quantity object to the appropriate SI base units:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Scope  (7)

Applications  (4)

Properties & Relations  (9)

Possible Issues  (2)

See Also

Quantity  UnitSimplify  UnitDimensions  CompatibleUnitQ

Tutorials

Introduced in 2012
(9.0)