Thanks for the insight. I guess I was thinking about reducing semi-duplicate data in the database, and converting the price in cents to a dollar amount felt like an ok’ish thing to do at runtime.
I’ll go with storing both in the database for this scenario.
However, in your second solution where you define those functions, wouldn’t you end up leaking out the context modules responsible for those functions inside of your template? I don’t know enough about Elixir yet to really determine what would happen with that 2nd pattern. I see it returns a map, but is that something you could technically pass into a template from a controller and iterate over just as if it were a list of ecto schema results?