修改了总统计数

This commit is contained in:
huang 2015-01-17 10:14:07 +08:00
parent f99d159ca1
commit 3acec4b7c1
3 changed files with 7 additions and 5 deletions

View File

@ -48,15 +48,16 @@ module PollHelper
end end
end end
#统计答题百分比 #统计答题百分比,统计结果保留两位小数
def statistics_result_percentage(e, t) def statistics_result_percentage(e, t)
e = e.to_f e = e.to_f
t = t.to_f t = t.to_f
t == 0 ? 0 : format("%.2f", e*100/t) t == 0 ? 0 : format("%.2f", e*100/t)
end end
def options_show p #页面体型显示
case p def options_show pq
case pq
when 1 when 1
"单选题" "单选题"
when 2 when 2
@ -65,4 +66,5 @@ module PollHelper
"问答题" "问答题"
end end
end end
end end

View File

@ -19,7 +19,7 @@
<% end %> <% end %>
<tr class="table_bluebg"> <tr class="table_bluebg">
<td class="td327"><%= l(:label_poll_valid_commit) %> </td> <td class="td327"><%= l(:label_poll_valid_commit) %> </td>
<td class="td42"><%= poll_question.poll_votes.count %></td> <td class="td42"><%= @poll.users.count %></td>
<td class="td287">&nbsp; </td> <td class="td287">&nbsp; </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -27,7 +27,7 @@
<div class="cl"></div> <div class="cl"></div>
<div class="ur_buttons"></div> <div class="ur_buttons"></div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
</div> </div>
</body> </body>
</html> </html>