From ed292c821638cb616ba6efa1fb7c2c2ea76e2a5c Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 27 Oct 2014 09:39:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E6=89=93=E5=88=86=E3=80=82=E6=8A=8A=E7=99=BE=E5=88=86?= =?UTF-8?q?=E6=AF=94=E5=8F=98=E6=88=90=E4=BA=BA=E6=95=B0=20Signed-off-by:?= =?UTF-8?q?=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/softapplications_controller.rb | 6 +++--- app/views/softapplications/show.html.erb | 2 +- config/locales/zh.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/softapplications_controller.rb b/app/controllers/softapplications_controller.rb index 0c7e2ade1..5b6111187 100644 --- a/app/controllers/softapplications_controller.rb +++ b/app/controllers/softapplications_controller.rb @@ -56,12 +56,12 @@ class SoftapplicationsController < ApplicationController stars_status = stars_reates.select("stars, count(*) as scount"). group("stars") - @stars_status_map = Hash.new(0.0) + @stars_status_map = Hash.new(0) stars_status.each do |star_status| percent = percent_of(star_status.scount, stars_reates_count).to_f - percent_m = format("%.2f", percent) + people = star_status.scount.to_i @stars_status_map["star#{star_status.stars.to_i}".to_sym] = - percent_m.to_s + "%" + people.to_s end @jours = @softapplication.journals_for_messages.order('created_on DESC') @image_results = [] diff --git a/app/views/softapplications/show.html.erb b/app/views/softapplications/show.html.erb index 5aa40bf90..7a2edfa1f 100644 --- a/app/views/softapplications/show.html.erb +++ b/app/views/softapplications/show.html.erb @@ -71,7 +71,7 @@