Skip to content

Commit

Permalink
SAK-28019 Grades with decimals sent from Samigo to Gradebook are reco…
Browse files Browse the repository at this point in the history
…rded wrong

git-svn-id: https://source.sakaiproject.org/svn/sam/trunk@315491 66ffb92e-73f9-0310-93c1-f5514f145a0a
  • Loading branch information
juanjmerono committed Nov 18, 2014
1 parent b0acfd9 commit 36ded53
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 36ded53

Please sign in to comment.