Decimal numbers are, by definition, fixed precision. And therefore they have to be represented in Elixir (and other languages) in some structured format to preserve the precision. In Elixir the decimal library is the go-to library as you have seen.
When iex calls a function, like Repo.all/1, it will Kernel.inspect/1 on the returned result so you can see it in a user-friendly fashion. This is not special to Repo functions in any way.
For Decimals that format is the common Elixir format for inspecting structs of #Decimal<10.90> as you have seen. This is a good thing. It tells you the structure and the value.
However its just the inspected format and not something you should be concerned about in any case I can think of.
Is there something in particular that makes this problematic for you?
This is mostly a mismatch between different parts of your application. Phoenix expects (for your case) a list of tuples, with a label and a value. Both need to be renderable by Phoenix.HTML, which is not the case for decimal structs. You’d need to convert the decimal to a string representation for phoenix to be able to render it in the way you showed.
It’s actually not related to the #Decimal<> construct. The message is an inspection of your content which as you know from the above has a certain output for decimals.
I believe you will need to convert your decimals to binaries first. I’m not familiar enough with Phoenix HTML rendering to help further. But I’m pretty confident thats the source of the issue.
As the others said, you aren’t formatting your Decimals in a way that is renderable in HTML. It does not happen automatically – Phoenix does not fantasise about how your data type can be shown in an inherently string format as HTML. So replacing the above with: