This commit is contained in:
Thomas Peterson 2019-09-26 14:09:56 +02:00
parent 6f115e53de
commit fb4593dda2
2 changed files with 11 additions and 1 deletions

View File

@ -113,7 +113,7 @@ class Calc
$formel = $this->formelCalc->parse($edge->getFormel());
if ($formel != "" && $option->getId() != 'weight' && !$option->isAjaxExport()) {
$p = 0;
$formel = str_replace("tonumber", '$this->toNumber', $formel);
eval('@$p = ' . $formel . ';');
if($p > 0 || $p < 0) {
$price += $p;
@ -129,4 +129,13 @@ class Calc
return $price;
}
private function toNumber($value)
{
if(strpos($value,',') == (strlen($value)-1)) {
return str_replace(',', '', $value);
}
return str_replace(',', '.', $value);
}
}

View File

@ -28,6 +28,7 @@ class Parser
case 'select':
$obj = new Select($node);
break;
case 'text':
case 'textarea':
$obj = new Text($node);
break;