@abaplint/runtime 2.1.64 → 2.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,7 +12,10 @@ function round(input) {
|
|
|
12
12
|
mode = mode === null || mode === void 0 ? void 0 : mode.get();
|
|
13
13
|
}
|
|
14
14
|
const val = (0, _parse_1.parse)(input.val);
|
|
15
|
-
|
|
15
|
+
const dec = (0, _parse_1.parse)(input.dec);
|
|
16
|
+
if (dec !== 0) {
|
|
17
|
+
throw "round(), todo, handle decimals";
|
|
18
|
+
}
|
|
16
19
|
const ret = new types_1.Float();
|
|
17
20
|
switch (mode) {
|
|
18
21
|
case 1:
|
|
@@ -21,8 +24,11 @@ function round(input) {
|
|
|
21
24
|
case 4:
|
|
22
25
|
ret.set(-Math.round(-val));
|
|
23
26
|
break;
|
|
27
|
+
case 6:
|
|
28
|
+
ret.set(Math.floor(val));
|
|
29
|
+
break;
|
|
24
30
|
default:
|
|
25
|
-
throw "round(), unknown mode";
|
|
31
|
+
throw "round(), unknown mode: " + mode;
|
|
26
32
|
}
|
|
27
33
|
return ret;
|
|
28
34
|
}
|