replacing round() with number_format (for a number betweem 0-100), because round does not respect decimal places, e.g. round(90.50, 2) = 90.5

This commit is contained in:
toyomoyo 2007-08-17 06:28:12 +00:00
parent 54c7e5e064
commit d8c684de7e

View File

@ -866,14 +866,13 @@ class grade_report_grader extends grade_report {
$rawvalue = $scaleval;
} else {
$gradeval = format_float($sum/$count_array[$item->id], $decimalpoints);
$gradehtml = round($gradeval, $decimalpoints);
$gradehtml = $gradeval;
$rawvalue = $gradeval;
}
if ($displaytype == GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE) {
$gradeval = grade_grade::standardise_score($rawvalue, $item->grademin, $item->grademax, 0, 100);
$gradehtml = round($gradeval, $decimalpoints) . '%';
$gradehtml = number_format($gradeval, $decimalpoints) . '%';
} elseif ($displaytype == GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER) {
$letters = grade_report::get_grade_letters();
$gradehtml = grade_grade::get_letter($letters, $gradeval, $item->grademin, $item->grademax);