Added FLOOR and CEIL function in operand.
This commit is contained in:
1 parent
5e0523619d
commit
63916cc32a
1 file changed
+20
-2
+20
-2
@@ -328,9 +328,27 @@ namespace jet {
|
||||
} else
|
||||
throw coreutils::Exception("Expecting ) at end of TRUNC expression.");
|
||||
} else if(in.ifNextIgnoreCase("CEIL")) {
|
||||
|
||||
if(!in.ifNext("("))
|
||||
throw coreutils::Exception("Expecting ( for CEIL parameters.");
|
||||
Operand parm1(in, tag);
|
||||
if(in.ifNext(")")) {
|
||||
doubleValue = ceil(parm1.doubleValue);
|
||||
isNumber = true;
|
||||
string = std::format("{:.12f}", doubleValue);
|
||||
string.removeTrailingZeros();
|
||||
} else
|
||||
throw coreutils::Exception("Expecting ) at end of CEIL expression.");
|
||||
} else if(in.ifNextIgnoreCase("FLOOR")) {
|
||||
|
||||
if(!in.ifNext("("))
|
||||
throw coreutils::Exception("Expecting ( for FLOOR parameters.");
|
||||
Operand parm1(in, tag);
|
||||
if(in.ifNext(")")) {
|
||||
doubleValue = floor(parm1.doubleValue);
|
||||
isNumber = true;
|
||||
string = std::format("{:.12f}", doubleValue);
|
||||
string.removeTrailingZeros();
|
||||
} else
|
||||
throw coreutils::Exception("Expecting ) at end of FLOOR expression.");
|
||||
} else if(in.ifNextIgnoreCase("UNIXTIME")) {
|
||||
if(!in.ifNext("("))
|
||||
throw coreutils::Exception("Expecting ( for UNIXTIME.");
|
||||
|
||||
Reference in new issue
Block a user