# Computing Ecto virtual field

**URL:** <https://forum.elixirforum.com/t/computing-ecto-virtual-field/37715>\
**Category:** Questions\
**Tags:** ecto\
**Created:** [February 22, 2021, 5:45am UTC](https://forum.elixirforum.com/t/computing-ecto-virtual-field/37715 "2021-02-22T05:45:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yos1p](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/yos1p/32/21891_2.png) [@yos1p](https://forum.elixirforum.com/u/yos1p)\
**Post date:** [February 22, 2021, 7:12am UTC](https://forum.elixirforum.com/t/computing-ecto-virtual-field/37715/3 "2021-02-22T07:12:50Z")

</div>

I would like to use it in my `.eex` file. What’s the best way to do this? So that I can simply use something like `<%= item.format_price %>` and that’s it.

If I use a function there, I find that I have to call something like:

```elixir
<%= ElixirApp.MasterData.Item.format_price(item) %>

```

Is there any way to avoid that?

---

_[View the full topic](https://forum.elixirforum.com/t/computing-ecto-virtual-field/37715)._
