ExDimensions v0.2.1 API Reference

Modules

ex_dimensions is a library for providing safe unit math and conversions. Units are tracked inside a struct that is labeled with phantom types for the units of the number, and transparent math is provided by macros. To get started, first any simple numeric must be "lifted" into a unit aware number. The easiest way is using the helper functions for the type of quantity you want to work with

Base units for area measurements in metric and imperial.

A module containing the DSL definitions for unit conversions

A custom Ecto type for integration into Ecto based projects. The column is defined as a :map Ecto type with 2 keys

Base units for mass measurements in metric and imperial.

This module contains the required macros to perform math on unit quantities. It must be used in the current scope for the math functions to work properly. Math on standard values will still work as expected if this module is used.

The core quantity type for units. It maintains bookkeeping around unit manipulations as math and conversion operations are applied. It is not recommended to create this struct directly. Rather, helpers such as ExDimensions.Spatial.inches(5) should be used to initialize quantities, and manipulations of the value should take place using the macro defined in ExDimensions.UnitMath.

Base units for spatial measurements in metric and imperial. See ExDimensions.Spatial.Area and ExDimensions.Spatial.Volume for helpers that can create quantities in square and cubed units.

Base units for temperature measurements.

Base behavior for a unit type.

Base units for volume measurements in metric and imperial.