Skip to content

Commit

Permalink
add formatting for number fields in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
phyr97 committed Aug 26, 2024
1 parent 71757de commit cca41d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion demo/lib/demo_web/live/post_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ defmodule DemoWeb.PostLive do
_assigns ->
true
end,
searchable: true
searchable: true,
render: fn assigns ->
~H"""
<p><%= Number.Delimit.number_to_delimited(@value, precision: 0, delimiter: ".") %></p>
"""
end
},
user: %{
module: Backpex.Fields.BelongsTo,
Expand Down
5 changes: 5 additions & 0 deletions demo/lib/demo_web/live/product_live.ex
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ defmodule DemoWeb.ProductLive do

error ->
error
end,
render: fn assigns ->
~H"""
<p><%= Number.Delimit.number_to_delimited(@value, precision: 0, delimiter: ".") %></p>
"""
end
},
price: %{
Expand Down

0 comments on commit cca41d7

Please sign in to comment.