Skip to content

Commit 4296cb4

Browse files
githubgxllwt0530
authored andcommitted
[fix][runtime] Fixed the round function's decimal place limit to be between -30 and 30
1 parent 41a3722 commit 4296cb4

File tree

1 file changed

+2
-2
lines changed
  • runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical

1 file changed

+2
-2
lines changed

runtime/src/main/java/io/dingodb/expr/runtime/op/mathematical/Round2Fun.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ static double round(double value, int scale) {
5757
}
5858

5959
static @NonNull BigDecimal round(@NonNull BigDecimal value, int scale) {
60-
if (-10 <= scale && scale <= 10) {
60+
if (-30 <= scale && scale <= 30) {
6161
BigDecimal result = value.setScale(scale, RoundingMode.HALF_UP);
6262
if (scale < 0) {
6363
result = result.setScale(0, RoundingMode.HALF_UP);
6464
}
6565
return result;
6666
}
6767
throw new ExprEvaluatingException(
68-
new ArithmeticException("Scale of " + NAME + " function must be in range [-10, 10].")
68+
new ArithmeticException("Scale of " + NAME + " function must be in range [-30, 30].")
6969
);
7070
}
7171

0 commit comments

Comments
 (0)