-
Bug
-
Resolution: Fixed
-
Minor
-
2.1
-
None
-
MOODLE_21_STABLE
-
MOODLE_21_STABLE
-
format_float function in
- question/type/calculated/db/upgradelib.php and
- question/type/calculatedmulti/db/upgradelib.php
seems broken
If and else if have same condition in function format_float.
public function format_float($x, $length = null, $format = null) {
|
if (!is_null($length) && !is_null($format)) {
|
if ($format == 1) {
|
// Decimal places.
|
$x = sprintf('%.' . $length . 'F', $x);
|
} else if ($format == 1) {
|
// Significant figures.
|
$x = sprintf('%.' . $length . 'g', $x);
|
$x = str_replace(',', '.', $x);
|
}
|
}
|
return $x;
|
}
|
- has a non-specific relationship to
-
MDL-27418 apply_unit() does not handle well is_numeric() valid numbers when decsep = ,
- Closed