fixed output of numeric output from expr().
This commit is contained in:
parent
3f14b28435
commit
db59e9e87c
@ -64,6 +64,11 @@ namespace jet {
|
|||||||
Operand op(parm1.string, tag);
|
Operand op(parm1.string, tag);
|
||||||
string = op.string;
|
string = op.string;
|
||||||
isNumber = op.isNumber;
|
isNumber = op.isNumber;
|
||||||
|
if(isNumber) {
|
||||||
|
doubleValue = op.doubleValue;
|
||||||
|
string = std::format("{:.12f}", doubleValue);
|
||||||
|
string.removeTrailingZeros();
|
||||||
|
}
|
||||||
boolean = op.boolean;
|
boolean = op.boolean;
|
||||||
} else
|
} else
|
||||||
throw coreutils::Exception("Expecting ) at end of EXPR expression.");
|
throw coreutils::Exception("Expecting ) at end of EXPR expression.");
|
||||||
|
|||||||
@ -1,5 +0,0 @@
|
|||||||
#!../jet-2.0
|
|
||||||
<jet name1="localname" filterblanklines="true" trimlines="true">
|
|
||||||
<set name="result" expr="2 + 2 * 3 + 2" />
|
|
||||||
$[result]=10
|
|
||||||
</jet>
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#!../jet-2.0
|
#!../jet-2.0
|
||||||
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
<jet cgi="true" name1="localname" filterblanklines="true" trimlines="true">
|
||||||
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
|
<mysql host="barant.com" database="barant" user="barant" password="uversa" sessionid="1">
|
||||||
<sql sessionid="1">select * from testdata</sql>
|
<sql sessionid="1">select * from testdata</sql>
|
||||||
<whilerow name="index" count="10" sessionid="1">
|
<whilerow name="index" count="10" sessionid="1">
|
||||||
$[1.id] $[1.text] $[1.value]
|
$[1.id] $[1.text] $[1.value]
|
||||||
|
|||||||
@ -23,4 +23,6 @@ $[result]=45
|
|||||||
$[result]=45
|
$[result]=45
|
||||||
<set name="result" expr="2 + 2 * 3 + 2" />
|
<set name="result" expr="2 + 2 * 3 + 2" />
|
||||||
$[result]=10
|
$[result]=10
|
||||||
|
<set name="result" expr="expr(2 + 2 * 3 + 2)" />
|
||||||
|
$[result]=10
|
||||||
</jet>
|
</jet>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user