Packages

Utility to convert values between different units of the same kind. Extremely easy to extend and to use.

Current section

Files

Jump to
ex_uc lib value.ex
Raw

lib/value.ex

defmodule ExUc.Value do
defstruct value: 0, unit: :none, kind: :any
end
defimpl String.Chars, for: ExUc.Value do
def to_string(val) do
"#{val.value}#{val.unit}"
end
end