Remove custom currency styling, use default formatter (#937)

This commit is contained in:
Zach Gollwitzer
2024-07-02 07:27:19 -04:00
committed by GitHub
parent 0593d8fb7e
commit 3089e3c81d

View File

@@ -3,13 +3,7 @@
<p class="text-sm text-gray-500 font-medium"><%= label %></p>
<p class="text-gray-900 -space-x-0.5">
<% if value.is_a?(Money) %>
<span class="text-gray-500"><%= value.currency.symbol %></span>
<span class="<%= size == "lg" ? "text-xl" : "text-lg" %> font-medium"><%= format_money_without_symbol value, precision: 0 %></span>
<%- if value.currency.default_precision.positive? -%>
<span class="text-gray-500">
<%= value.currency.separator %><%= value.cents_str %>
</span>
<% end %>
<span class="<%= size == "lg" ? "text-xl" : "text-lg" %> font-medium"><%= format_money value %></span>
<% else %>
<span class="<%= size == "lg" ? "text-xl" : "text-lg" %> font-medium"><%= is_percentage ? number_to_percentage(value, precision: 2) : value %></span>
<% end %>