Suppose I have this following schema:
schema "items" do
field :code, :string
field :name, :string
field :sell_price, :decimal
timestamps()
end
I wanted to have a virtual field, where it will format my sell_price field as string. I recall, in Ecto, you can do this:
field :formatted_sell_price, :string, virtual: true
My question is, how to make Ecto always compute that field to the format that I want? Suppose I already have my own formatting code with Money or Number.






















