From 36ded5383d1a6b364662c352479506643ec8c4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Mero=C3=B1o=20S=C3=A1nchez?= Date: Tue, 18 Nov 2014 09:04:50 +0000 Subject: [PATCH] SAK-28019 Grades with decimals sent from Samigo to Gradebook are recorded wrong git-svn-id: https://source.sakaiproject.org/svn/sam/trunk@315491 66ffb92e-73f9-0310-93c1-f5514f145a0a --- .../facade/AssessmentGradingFacadeQueries.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java index fd0463d5a815..22182f26181d 100644 --- a/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java +++ b/samigo/samigo-services/src/java/org/sakaiproject/tool/assessment/facade/AssessmentGradingFacadeQueries.java @@ -28,6 +28,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -3379,7 +3380,13 @@ public Object doInHibernate(Session session) throws HibernateException, SQLExcep cumulativeScore+=agd.getFinalScore(); } averageScore= cumulativeScore/assessmentGradings.size(); - averageScore= new Double((new DecimalFormat("0.##").format((double)averageScore))); + + DecimalFormat df = new DecimalFormat("0.##"); + DecimalFormatSymbols dfs = new DecimalFormatSymbols(); + dfs.setDecimalSeparator('.'); + df.setDecimalFormatSymbols(dfs); + + averageScore= new Double(df.format((double)averageScore)); } return averageScore; }