Revision d59ca2b3
Von Wulf Coulmann vor mehr als 13 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1164 | 1164 |
if ( ($myconfig->{numberformat} eq '1.000,00') |
1165 | 1165 |
|| ($myconfig->{numberformat} eq '1000,00')) { |
1166 | 1166 |
$amount =~ s/\.//g; |
1167 |
$amount =~ s/,/\./; |
|
1167 |
$amount =~ s/,/\./g;
|
|
1168 | 1168 |
} |
1169 | 1169 |
|
1170 | 1170 |
if ($myconfig->{numberformat} eq "1'000.00") { |
... | ... | |
1172 | 1172 |
} |
1173 | 1173 |
|
1174 | 1174 |
$amount =~ s/,//g; |
1175 |
# make shure no code wich is not a math expression ends in eval() |
|
1176 |
|
|
1177 |
$amount =~ s/\s//g; |
|
1178 |
|
|
1179 |
unless($amount =~ /^[-\+]?\d+\.?\d*([-\+\*\/][-\+]?\d+\.?\d*)*$/){ |
|
1180 |
return 0; |
|
1181 |
} |
|
1175 | 1182 |
|
1176 | 1183 |
$main::lxdebug->leave_sub(2); |
1177 | 1184 |
|
1178 |
return ($amount * 1);
|
|
1185 |
return (eval $amount) * 1 ;
|
|
1179 | 1186 |
} |
1180 | 1187 |
|
1181 | 1188 |
sub round_amount { |
Auch abrufbar als: Unified diff
add number calculation in number form fields