4
0
Fork 0

Documented to_wei and from_wei

travis-fix
hswick 6 years ago
parent a84b8bfbae
commit f44f9d43e7
  1. 4
      lib/exw3.ex
  2. 2
      mix.exs

@ -40,6 +40,8 @@ defmodule ExW3 do
@unit_map @unit_map
end end
@spec to_wei(integer(), keyword()) :: integer()
@doc "Converts the value to whatever unit key is provided. See unit map for details."
def to_wei(num, key) do def to_wei(num, key) do
if @unit_map[key] do if @unit_map[key] do
num * @unit_map[key] num * @unit_map[key]
@ -48,6 +50,8 @@ defmodule ExW3 do
end end
end end
@spec from_wei(integer(), keyword()) :: integer()
@doc "Converts the value to whatever unit key is provided. See unit map for details."
def from_wei(num, key) do def from_wei(num, key) do
if @unit_map[key] do if @unit_map[key] do
num / @unit_map[key] num / @unit_map[key]

@ -4,7 +4,7 @@ defmodule ExW3.MixProject do
def project do def project do
[ [
app: :exw3, app: :exw3,
version: "0.4.1", version: "0.4.2",
elixir: "~> 1.7.2", elixir: "~> 1.7.2",
build_embedded: Mix.env == :prod, build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod, start_permanent: Mix.env == :prod,

Loading…
Cancel
Save