Commit fb69af5d authored by Carsten  Rose's avatar Carsten Rose
Browse files

Check not to try to number_format() empty string.

parent 27cd2105
Pipeline #1142 passed with stage
in 1 minute and 34 seconds
......@@ -1246,9 +1246,11 @@ abstract class AbstractBuildForm {
$value = '';
}
if ($formElement[FE_DECIMAL_FORMAT] !== '') {
$decimalScale = explode(',', $formElement[FE_DECIMAL_FORMAT])[1]; // scale: Nachkommastellen
$value = number_format($value, $decimalScale, '.', '');
if ($formElement[FE_DECIMAL_FORMAT] !== '' ) {
if($value!=='') { // empty string causes exception in number_format()
$decimalScale = explode(',', $formElement[FE_DECIMAL_FORMAT])[1]; // scale: Nachkommastellen
$value = number_format($value, $decimalScale, '.', '');
}
}
// In case the user specifies MIN & MAX with numbers, the html tag 'type' has to be 'number', to make the range check work in the browser.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment