Added {calc} operation to produce inline calculations in templates

This commit is contained in:
f0o
2016-03-02 16:33:46 +00:00
parent 3a65fab2fb
commit 34e0146d8e

View File

@@ -390,6 +390,10 @@ function FormatAlertTpl($obj) {
$pos = $x;
$for = true;
}
else if ($buff == '{calc') {
$pos = $x;
$calc = true;
}
if ($pos != -1 && $msg[$x] == '}') {
$orig = $buff;
@@ -411,6 +415,14 @@ function FormatAlertTpl($obj) {
' as $key=>$value) { $ret .= "',
);
}
else if ($calc) {
$calc = false;
$o = 5;
$native = array(
'"; $ret .= (float) (0+(',
')); $ret .= "',
);
}
else {
continue;
}