ExDimensions v0.2.0 ExDimensions.Conversions View Source

A module containing the DSL definitions for unit conversions

Link to this section Summary

Functions

DSL function for converting a quantity of a given value to some other unit, if there is an available conversion. If so, the new quantity is returned. If not, then an error tuple is returned. This module must be imported into the current scope for this function to be available.

Link to this section Functions

Link to this function

quantity ~> u2

View Source (since 0.1.0)

DSL function for converting a quantity of a given value to some other unit, if there is an available conversion. If so, the new quantity is returned. If not, then an error tuple is returned. This module must be imported into the current scope for this function to be available.

Examples

iex> import ExDimensions.Conversions
iex> IO.puts(ExDimensions.Spatial.feet(1) ~> ExDimensions.Spatial.Inches)
"12 in"