From f30acd7fe2a274dee8bce0a1bffa1d57d883d014 Mon Sep 17 00:00:00 2001 From: shibao Date: Tue, 15 Feb 2022 22:01:38 -0500 Subject: [PATCH] gettext monetary amounts --- lib/cannery_web/components/ammo_group_card.ex | 2 +- lib/cannery_web/live/ammo_group_live/index.html.heex | 2 +- lib/cannery_web/live/ammo_group_live/show.html.heex | 2 +- lib/cannery_web/live/ammo_type_live/show.html.heex | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cannery_web/components/ammo_group_card.ex b/lib/cannery_web/components/ammo_group_card.ex index 1fd6ab5..478ce53 100644 --- a/lib/cannery_web/components/ammo_group_card.ex +++ b/lib/cannery_web/components/ammo_group_card.ex @@ -38,7 +38,7 @@ defmodule CanneryWeb.Components.AmmoGroupCard do <%= if @ammo_group.price_paid do %> - <%= gettext("Price paid:") %> $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %> + <%= gettext("Price paid:") %> <%= gettext("$%{amount}", amount: @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)) %> <% end %> diff --git a/lib/cannery_web/live/ammo_group_live/index.html.heex b/lib/cannery_web/live/ammo_group_live/index.html.heex index c7ee251..03de1d4 100644 --- a/lib/cannery_web/live/ammo_group_live/index.html.heex +++ b/lib/cannery_web/live/ammo_group_live/index.html.heex @@ -60,7 +60,7 @@ <%= if ammo_group.price_paid do %> - $ <%= ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %> + <%= gettext("$%{amount}", amount: ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)) %> <% end %> diff --git a/lib/cannery_web/live/ammo_group_live/show.html.heex b/lib/cannery_web/live/ammo_group_live/show.html.heex index 7d85326..66b2cdd 100644 --- a/lib/cannery_web/live/ammo_group_live/show.html.heex +++ b/lib/cannery_web/live/ammo_group_live/show.html.heex @@ -18,7 +18,7 @@ <%= if @ammo_group.price_paid do %> - <%= gettext("Price paid:") %> $ <%= @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %> + <%= gettext("Price paid:") %> <%= gettext("$%{amount}", amount: @ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2)) %> <% end %> diff --git a/lib/cannery_web/live/ammo_type_live/show.html.heex b/lib/cannery_web/live/ammo_type_live/show.html.heex index 99139cb..51aa455 100644 --- a/lib/cannery_web/live/ammo_type_live/show.html.heex +++ b/lib/cannery_web/live/ammo_type_live/show.html.heex @@ -87,7 +87,7 @@ - <%= @avg_cost_per_round |> :erlang.float_to_binary(decimals: 2) %> + <%= gettext("$%{amount}", amount: @avg_cost_per_round |> :erlang.float_to_binary(decimals: 2)) %> <% end %>