Index: assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java =================================================================== --- assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java (revision 131766) +++ assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java (working copy) @@ -4731,10 +4731,14 @@ try { // numeric cell type? - String grade = submission.getGradeForUser(userId) == null ? submission.getGrade(): - submission.getGradeForUser(userId); + String grade = submission.getGradeForUser(userId) == null ? submission.getGradeDisplay(): + submission.getGradeForUser(userId); - Float.parseFloat(grade); + //We get float number no matter the locale it was managed with. + NumberFormat nbFormat = NumberFormat.getNumberInstance(rb.getLocale()); + nbFormat.setMaximumFractionDigits(1); + nbFormat.setMinimumFractionDigits(1); + float f = nbFormat.parse(grade).floatValue(); // remove the String-based cell first cell = row.getCell(cellNum); @@ -4742,7 +4746,7 @@ // add number based cell cell=row.createCell(cellNum); cell.setCellType(0); - cell.setCellValue(Float.parseFloat(grade)/10); + cell.setCellValue(f); style = wb.createCellStyle(); style.setDataFormat(wb.createDataFormat().getFormat("#,##0.0")); @@ -4751,11 +4755,11 @@ catch (Exception e) { // if the grade is not numeric, let's make it as String type - row.removeCell(cell); - cell=row.createCell(cellNum); + // No need to remove the cell and create a new one, as the existing one is String type. + cell = row.getCell(cellNum); cell.setCellType(1); - cell.setCellValue(submission.getGradeForUser(userId) == null ? submission.getGrade(): - submission.getGradeForUser(userId)); + cell.setCellValue(submission.getGradeForUser(userId) == null ? submission.getGradeDisplay(): + submission.getGradeForUser(userId)); } } else @@ -4763,7 +4767,7 @@ // String cell type cell = row.getCell(cellNum); cell.setCellValue(submission.getGradeForUser(userId) == null ? submission.getGradeDisplay(): - submission.getGradeForUser(userId)); + submission.getGradeForUser(userId)); } } else if (submission.getSubmitted() && submission.getTimeSubmitted() != null) @@ -4793,15 +4797,20 @@ { // numeric cell type? String grade = submission.getGradeDisplay(); - Float.parseFloat(grade); + //We get float number no matter the locale it was managed with. + NumberFormat nbFormat = NumberFormat.getNumberInstance(rb.getLocale()); + nbFormat.setMaximumFractionDigits(1); + nbFormat.setMinimumFractionDigits(1); + float f = nbFormat.parse(grade).floatValue(); + // remove the String-based cell first cell = row.getCell(cellNum); row.removeCell(cell); // add number based cell cell=row.createCell(cellNum); cell.setCellType(0); - cell.setCellValue(Float.parseFloat(grade)); + cell.setCellValue(f); style = wb.createCellStyle(); style.setDataFormat(wb.createDataFormat().getFormat("#,##0.0")); @@ -4810,10 +4819,11 @@ catch (Exception e) { // if the grade is not numeric, let's make it as String type - row.removeCell(cell); - cell=row.createCell(cellNum); + // No need to remove the cell and create a new one, as the existing one is String type. + cell = row.getCell(cellNum); cell.setCellType(1); - cell.setCellValue(submission.getGrade()); + // Setting grade display instead grade. + cell.setCellValue(submission.getGradeDisplay()); } } else