ianmackenzie/elm-units-prefixed/2.2.0

NOTE: the latest version is 2.8.0

Units.Length

A Length represents a length in meters, feet, centimeters, miles etc. It is stored as a number of meters.

type alias Length =
Length
type alias Meters =
Meters

Metric

meters : Float -> Length

Construct a length from a number of meters.

height : Length
height =
    Length.meters 2
inMeters : Length -> Float

Convert a length to a number of meters.

Length.feet 1 |> Length.inMeters
--> 0.3048
microns : Float -> Length

Construct a length from a number of microns (micrometers).

Length.microns 1
--> Length.meters 1e-6
inMicrons : Length -> Float

Convert a length to a number of microns (micrometers).

Length.millimeters 1 |> Length.inMicrons
--> 1000
millimeters : Float -> Length

Construct a length from number of millimeters.

inMillimeters : Length -> Float

Convert a length to number of millimeters.

centimeters : Float -> Length

Construct a length from a number of centimeters.

inCentimeters : Length -> Float

Convert a length to a number of centimeters.

kilometers : Float -> Length

Construct a length from a number of kilometers.

inKilometers : Length -> Float

Convert a length to a number of kilometers.

Imperial

thou : Float -> Length

Construct a length from a number of thou (thousandths of an inch).

Length.thou 5
--> Length.inches 0.005
inThou : Length -> Float

Convert a length to a number of thou (thousandths of an inch).

Length.millimeters 1 |> Length.inThou
--> 39.37007874015748
inches : Float -> Length

Construct a length from a number of inches.

inInches : Length -> Float

Convert a length to a number of inches.

feet : Float -> Length

Construct a length from a number of feet.

inFeet : Length -> Float

Convert a length to a number of feet.

yards : Float -> Length

Construct a length from a number of yards.

inYards : Length -> Float

Convert a length to a number of yards.

miles : Float -> Length

Construct a length from a number of miles.

inMiles : Length -> Float

Convert a length to a number of miles.

Astronomical

astronomicalUnits : Float -> Length

Construct a length from a number of astronomical units (AU). One AU is approximately equal to the average distance of the Earth from the Sun.

inAstronomicalUnits : Length -> Float

Convert a length to a number of astronomical units.

parsecs : Float -> Length

Construct a length from a number of parsecs.

inParsecs : Length -> Float

Convert a length to a number of parsecs.

lightYears : Float -> Length

Construct a length from a number of light years. One light year is the distance traveled when moving at the speed of light for one Julian year.

inLightYears : Length -> Float

Convert a length to a number of light years.