Nutriment | Relevé | Cible | Delta |
---|---|---|---|
<%= nut.upcase %> | <% if measured.nil? %> — <% else %> <%= number_with_precision(measured, precision: 2) %> <% end %> | <% if target.nil? %> — <% else %> <%= number_with_precision(target, precision: 2) %> <% end %> | <% if measured.nil? && target.nil? %> — <% else %> <% badge = if delta.nil? "text-bg-secondary" elsif delta.abs <= 0.01 "text-bg-success" elsif delta > 0 "text-bg-warning" else "text-bg-danger" end %> <%= number_with_precision(delta.to_f, precision: 2) %> <% end %> |