From 910c2ab7b447447185c7ad67040e1c66cd7d2d2d Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Mon, 25 Nov 2019 15:24:48 +1100 Subject: [PATCH] MDL-67151 qtype_calculated: Support for the scientific format --- question/type/calculated/datasetitems_form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/question/type/calculated/datasetitems_form.php b/question/type/calculated/datasetitems_form.php index 21ac15f32fa..a29cc7bfe37 100644 --- a/question/type/calculated/datasetitems_form.php +++ b/question/type/calculated/datasetitems_form.php @@ -410,7 +410,7 @@ class question_dataset_dependent_items_form extends question_wizard_form { if ($this->_form->getElementType("number[{$j}]") == 'hidden') { // Some of the number elements are from the float type and some are from the hidden type. // We need to manually handle localised floats for hidden elements. - $value = format_float($value, strlen($value), true, true); + $value = format_float($value, -1); } $formdata["number[{$j}]"] = $value; $formdata["definition[{$j}]"] = $defid; @@ -449,7 +449,7 @@ class question_dataset_dependent_items_form extends question_wizard_form { if ($this->_form->getElementType("number[{$j}]") == 'hidden') { // Some of the number elements are from the float type and some are from the hidden type. // We need to manually handle localised floats for hidden elements. - $value = format_float($value, strlen($value), true, true); + $value = format_float($value, -1); } $formdata["number[{$j}]"] = $value; $formdata["definition[{$j}]"] = $defid;