This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
0.0.3
Convert between quantities in different unit.
version 1.0.0
license BSD3
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.0
Committed At 2017-02-12 20:37:46 UTC
elm-lang/html 2.0.0 <= v < 3.0.0 2.0.0
elm-lang/core 5.1.1 <= v < 6.0.0 5.1.1

README

elm-convert-units

Elm library for converting between quantities in different units. Inspired by https://github.com/ben-ng/convert-units

Usage

import ConvertUnits exposing (convert, describe, possibilities, isPossible)
import ConvertUnits.Definitions exposing (Category(Area), Descriptor)

oneMeterToFoot : Result String Float
oneMeterToFoot = convert 1.0 "m" "ft"

tenKgToOz : Result String Float
tenKgToOz = convert 10.0 "kg "oz"

inches : Maybe Descriptor
inches = describe "in" // == { abbr: "in" , singluar: "Inch", plural: "Inches", toAnchor : (1 / 12) }

canPixels : Bool
canPixels = isPossible "px" // == False

areaUnits : List String
areaUnits = possibilities Area // == [ "mm2", "cm2", "m2", "ha", "km2", "in2", "ft2", "ac", "mi2" ]