ianmackenzie/elm-units/1.0.0

NOTE: the latest version is 2.10.0

Energy

An Energy value represents an amount of energy (or work) in joules, kilowatt hours etc. It is stored as a number of joules.

type alias Energy =
type Joules
joules : Float -> Energy

Construct an energy value from a number of joules.

inJoules : Energy -> Float

Convert an energy value to a number of joules.

kilojoules : Float -> Energy

Construct an energy value from a number of kilojoules.

inKilojoules : Energy -> Float

Convert an energy value to a number of kilojoules.

megajoules : Float -> Energy

Construct an energy value from a number of megajoules.

inMegajoules : Energy -> Float

Convert an energy value to a number of megajoules.

kilowattHours : Float -> Energy

Construct an energy value from a number of kilowatt hours.

Energy.kilowattHours 1
--> Energy.megajoules 3.6
inKilowattHours : Energy -> Float

Convert an energy value to a number of kilowatt hours.