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/show.html.erb b/app/views/poll/show.html.erb index 42818dd34..c1ac5d377 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -2,7 +2,7 @@ - 问卷调查_问卷页面 + <%= l(:label_poll_title) %> <%= stylesheet_link_tag 'polls', :media => 'all' %>