ianmackenzie / elm-units

Simple, safe and convenient unit types and conversions for Elm
https://package.elm-lang.org/packages/ianmackenzie/elm-units/latest/
BSD 3-Clause "New" or "Revised" License
85 stars 14 forks source link

Add Quantity.half, Quantity.twice convenience functions? #37

Closed ianmackenzie closed 5 years ago

ianmackenzie commented 5 years ago

Multiplying by 0.5 or 2 is pretty common, so make those cases a bit more convenient:

Quantity.half : Quantity Float units -> Quantity Float units
Quantity.twice : Quantity number units -> Quantity number units

Equivalent to Quantity.multiplyBy 0.5 and Quantity.multiplyBy 2 respectively.