forked from Trustie/forgeplus
竞赛打分保留4位小数
This commit is contained in:
parent
ef33193f01
commit
f93c1dff0b
|
|
@ -24,7 +24,7 @@ class CompetitionAutoScoreJob < ApplicationJob
|
|||
data = JSON.parse response.body
|
||||
status = data[:status].to_s == "0" ? 2 : 3
|
||||
if data["status"].to_s == "0"
|
||||
score = data["score"].to_f
|
||||
score = format("%.4f", data["score"].to_f).to_f
|
||||
competition_score = competition_team.competition_scores.present? ? competition_team.competition_scores.first : competition_team.competition_scores.new
|
||||
competition_score.score = score
|
||||
competition_score.competition_id = competition_team.competition_id
|
||||
|
|
|
|||
Loading…
Reference in New Issue