<% if previous != 0 %> <% change = (Float(previous - current) / previous * 100).ceil.abs %> <% elsif (previous == 0 && current > 0) %> <% change = 100 %> <% end %> <% if current > previous %> <%= crayons_icon_tag(:increase, width: 18, height: 18, class: "color-accent-success") %> <%= change %>% increase <% elsif current < previous %> <%= crayons_icon_tag(:decrease, width: 18, height: 18, class: "color-accent-danger") %> <%= change %>% decrease <% else %> No change <% end %>