MDL-67151 qtype_calculatedsimple: Support for the scientific format

This commit is contained in:
Shamim Rezaie 2019-11-25 17:07:11 +11:00
parent a1f10c5ec5
commit 9173b83e58

View File

@ -508,8 +508,7 @@ class qtype_calculatedsimple_edit_form extends qtype_calculated_edit_form {
$mform->addElement('hidden', "number[{$j}]", '');
$mform->setType("number[{$j}]", PARAM_LOCALISEDFLOAT); // Localisation handling has to be done manually.
if (isset($this->formdata["number[{$j}]"])) {
$number = $this->formdata["number[{$j}]"];
$this->formdata["number[{$j}]"] = format_float($number, strlen($number), true, true);
$this->formdata["number[{$j}]"] = format_float($this->formdata["number[{$j}]"], -1);
}
}