mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
gradebook MDL-22670 Altered grade_edit_tree::format_number() to trim to a minimum of 1 decimal place. Longer numbers are limited to 4 decimal places.
This commit is contained in:
parent
73185e826c
commit
4592df46cb
@ -377,10 +377,15 @@ class grade_edit_tree {
|
||||
}
|
||||
}
|
||||
|
||||
//Trim's trailing zeros. Used on the 'categories and items' page for grade items settings like aggregation co-efficient
|
||||
//Trim's trailing zeros
|
||||
//Used on the 'categories and items' page for grade items settings like aggregation co-efficient
|
||||
//Grader report has its own decimal place settings so they are handled elsewhere
|
||||
function format_number($number) {
|
||||
return rtrim(rtrim(format_float($number, 4),'0'),'.');
|
||||
$formatted = rtrim(format_float($number, 4),'0');
|
||||
if (substr($formatted, -1)=='.') { //if last char is the decimal point
|
||||
$formatted .= '0';
|
||||
}
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user