diff --git a/app/helpers/poll_helper.rb b/app/helpers/poll_helper.rb
index 1a8fabae3..55418faf2 100644
--- a/app/helpers/poll_helper.rb
+++ b/app/helpers/poll_helper.rb
@@ -50,7 +50,9 @@ module PollHelper
#统计答题百分比
def statistics_result_percentage(e, t)
- return e*100/t
+ e = e.to_f
+ t = t.to_f
+ t == 0 ? 0 : format("%.2f", e*100/t)
end
def options_show p
diff --git a/app/views/poll/statistics_result.html.erb b/app/views/poll/statistics_result.html.erb
index dea18f8d8..057314a9c 100644
--- a/app/views/poll/statistics_result.html.erb
+++ b/app/views/poll/statistics_result.html.erb
@@ -1,38 +1,33 @@
-
-
-
-
<%= @poll.polls_name %> <%= l(:label_poll) %>
-
-
-<% @poll_questions.each do |poll_question| %>
-
-
- -
-
- 第<%= poll_question.question_number %>题:<%= poll_question.question_title %>
- [<%= options_show(poll_question.question_type) %>]
-
- <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
-
-
- <% end %>
-
- <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
-
-
-
-
-
-
-
-
+
+
+
+
<%= @poll.polls_name %> <%= l(:label_poll) %>
+
+ <% @poll_questions.each do |poll_question| %>
+
+
+ -
+
+ 第<%= poll_question.question_number %>题:<%= poll_question.question_title %> [<%= options_show(poll_question.question_type) %>]
+
+ <%= render :partial =>'choice_show', :locals =>{ :poll_question => poll_question } %>
+
+
+ <% end %>
+
+ <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
+
+
+
+
+
+
+