ianmackenzie/elm-units-prefixed/2.7.0

NOTE: the latest version is 2.8.0

Units.Molarity

A Molarity value represents a concentration of substance in moles per cubic meter, moles per liter, millimoles per liter etc. It is stored as a number of moles per cubic meter.

Note that the NIST Guide to the SI states that the term "molarity" is considered obsolete, but it appears to still be in common use and is far less verbose than the alternative NIST suggestion of "amount-of-substance concentration".

Since the units of Molarity are defined to be Rate Moles CubicMeters (amount of substance per unit volume), you can construct a Molarity value using Quantity.per:

molarity =
    substanceAmount |> Quantity.per volume

You can also do rate-related calculations with Molarity values to compute SubstanceAmount or Volume:

substanceAmount =
    volume |> Quantity.at molarity


volume =
    substanceAmount |> Quantity.at_ molarity
type alias Molarity =
Molarity
type alias MolesPerCubicMeter =
MolesPerCubicMeter
molesPerCubicMeter : Float -> Molarity

Construct a molarity from a number of moles per cubic meter.

inMolesPerCubicMeter : Molarity -> Float

Convert a molarity to a number of moles per cubic meter.

molesPerLiter : Float -> Molarity

Construct a molarity from a number of moles per liter.

inMolesPerLiter : Molarity -> Float

Convert a molarity to a number of moles per liter.

decimolesPerLiter : Float -> Molarity

Construct a molarity from a number of decimoles per liter.

inDecimolesPerLiter : Molarity -> Float

Convert a molarity to a number of decimoles per liter.

centimolesPerLiter : Float -> Molarity

Construct a molarity from a number of centimoles per liter.

inCentimolesPerLiter : Molarity -> Float

Convert a molarity to a number of centimoles per liter.

millimolesPerLiter : Float -> Molarity

Construct a molarity from a number of millimoles per liter.

inMillimolesPerLiter : Molarity -> Float

Convert a molarity to a number of millimoles per liter.

micromolesPerLiter : Float -> Molarity

Construct a molarity from a number of micromoles per liter.

inMicromolesPerLiter : Molarity -> Float

Convert a molarity to a number of micromoles per liter.