Commit afbb7c31e91c6dc5382e338b11257e6680fc1312
Committed by
Diego Camarinha
1 parent
746d4c25
Exists in
master
and in
29 other branches
[Mezuro] Refactored number formatting.
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
plugins/mezuro/views/content_viewer/_module_result.rhtml
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | <% range = metric_result.range %> |
20 | 20 | <tr title="<%= range.nil? ? '' : range.comments %>"> |
21 | 21 | <td><%= metric_result.metric.name %></td> |
22 | - <td><%= metric_result.value.to_f.round(2).to_s %></td> | |
22 | + <td><%= metric_result.value.slice(/[0-9]+\.[0-9]{2}/) %></td> <!--FIXME: Move to helper eventually--> | |
23 | 23 | <td><%= metric_result.weight %></td> |
24 | 24 | <% if range.nil? %> |
25 | 25 | <td></td> |
... | ... | @@ -34,7 +34,7 @@ |
34 | 34 | <td colspan = "4" align = "right"> |
35 | 35 | <strong> |
36 | 36 | <%= _('Grade:') %> |
37 | - <%= module_result.grade.to_f.round(2).to_s %> | |
37 | + <%= module_result.grade.slice(/[0-9]+\.[0-9]{2}/) %> <!--FIXME: Move to helper eventually --> | |
38 | 38 | </strong> |
39 | 39 | </td> |
40 | 40 | </tr> | ... | ... |