currency v1.0.0 Currency.Ecto
Provides a custom type for use in an Ecto schema to use Currency as a field type.
Usage:
Schema:
defmodule Thing do
use Ecto.Schema
schema "things" do
field :name, :string
field :cost, Currency.Ecto
end
end
Migration:
def change do
execute "CREATE TYPE currency AS (
units integer,
precision integer,
currency varchar
);
"
create table(:things) do
add :name, :string
add :cost, :currency
end
end
Link to this section Summary
Link to this section Functions
Link to this function
cast(_)
Link to this function
dump(arg1)
Link to this function
load(arg1)
Link to this function