mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 13:35:21 +02:00
Hide infinity trend percentage changes (#1261)
This commit is contained in:
parent
d2a6ab1e45
commit
c397f1bd2b
2 changed files with 8 additions and 2 deletions
|
@ -1,10 +1,14 @@
|
|||
<%# locals: { trend: } %>
|
||||
|
||||
<% styles = trend_styles(trend) %>
|
||||
|
||||
<p class="text-sm <%= styles[:text_class] %>">
|
||||
<% if trend.direction.flat? %>
|
||||
<span>No change</span>
|
||||
<% else %>
|
||||
<span><%= styles[:symbol] %><%= trend.value.is_a?(Money) ? format_money(trend.value.abs) : trend.value.abs.round(2) %></span>
|
||||
<span>(<%= lucide_icon(styles[:icon], class: "w-4 h-4 align-text-bottom inline") %><%= trend.percent.abs %>%)</span>
|
||||
<% unless trend.percent.infinite? %>
|
||||
<span>(<%= lucide_icon(styles[:icon], class: "w-4 h-4 align-text-bottom inline") %><%= trend.percent.abs %>%)</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</p>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue