mirror of
https://github.com/actiontech/dble.git
synced 2026-05-18 22:00:16 -05:00
round
This commit is contained in:
+4
@@ -6,6 +6,7 @@
|
||||
package com.actiontech.dble.plan.common.item.function.mathsfunc;
|
||||
|
||||
import com.actiontech.dble.plan.common.item.Item;
|
||||
import com.actiontech.dble.plan.common.item.ItemInt;
|
||||
import com.actiontech.dble.plan.common.item.function.ItemFunc;
|
||||
|
||||
import java.util.List;
|
||||
@@ -19,6 +20,9 @@ public class ItemFuncRound extends ItemFuncRoundOrTruncate {
|
||||
|
||||
@Override
|
||||
public ItemFunc nativeConstruct(List<Item> realArgs) {
|
||||
if (realArgs != null && realArgs.size() == 1) {
|
||||
realArgs.add(new ItemInt(0));
|
||||
}
|
||||
return new ItemFuncRound(realArgs);
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -6,6 +6,7 @@
|
||||
package com.actiontech.dble.plan.common.item.function.mathsfunc;
|
||||
|
||||
import com.actiontech.dble.plan.common.item.Item;
|
||||
import com.actiontech.dble.plan.common.item.ItemInt;
|
||||
import com.actiontech.dble.plan.common.item.function.primary.ItemFuncNum1;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -18,6 +19,9 @@ public abstract class ItemFuncRoundOrTruncate extends ItemFuncNum1 {
|
||||
|
||||
public ItemFuncRoundOrTruncate(List<Item> args, boolean truncate) {
|
||||
super(args);
|
||||
if (this.args != null && this.args.size() == 1) {
|
||||
this.args.add(new ItemInt(0));
|
||||
}
|
||||
this.truncate = truncate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user