MDL-67151 qtype_calculatedsimple: Support for the scientific format
authorShamim Rezaie <shamim@moodle.com>
Mon, 25 Nov 2019 06:07:11 +0000 (17:07 +1100)
committerShamim Rezaie <shamim@moodle.com>
Tue, 3 Dec 2019 05:52:22 +0000 (16:52 +1100)
question/type/calculatedsimple/edit_calculatedsimple_form.php

index a48372e..7af36e2 100644 (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);
                             }
                         }