@abaplint/runtime 2.3.29 → 2.3.31

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.
@@ -6,7 +6,7 @@ const types_1 = require("../types");
6
6
  function round(input) {
7
7
  let mode = input.mode;
8
8
  if (mode === undefined) {
9
- mode = 1;
9
+ mode = 2;
10
10
  }
11
11
  else if (typeof mode !== "number") {
12
12
  mode = mode === null || mode === void 0 ? void 0 : mode.get();
@@ -21,9 +21,15 @@ function round(input) {
21
21
  case 1:
22
22
  ret.set(Math.ceil(val));
23
23
  break;
24
+ case 2:
25
+ ret.set(Math.round(val));
26
+ break;
24
27
  case 4:
25
28
  ret.set(-Math.round(-val));
26
29
  break;
30
+ case 5:
31
+ ret.set(Math.trunc(val));
32
+ break;
27
33
  case 6:
28
34
  ret.set(Math.floor(val));
29
35
  break;
@@ -35,6 +35,9 @@ function parse(val) {
35
35
  else if (val instanceof types_1.Time || val instanceof types_1.Date) {
36
36
  return val.getNumeric();
37
37
  }
38
+ else if (val instanceof types_1.DecFloat34) {
39
+ return val.getRaw();
40
+ }
38
41
  else {
39
42
  return parse(val.get());
40
43
  }
@@ -15,7 +15,7 @@ class Integer {
15
15
  }
16
16
  set(value) {
17
17
  if (typeof value === "number") {
18
- this.value = value;
18
+ this.value = Math.round(value);
19
19
  }
20
20
  else if (typeof value === "string" && value.trim().length === 0) {
21
21
  this.value = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.3.29",
3
+ "version": "2.3.31",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",