@abaplint/runtime 2.7.162 → 2.7.164

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.
@@ -8,6 +8,7 @@ type options = {
8
8
  width?: number;
9
9
  decimals?: number;
10
10
  currency?: any;
11
+ style?: any;
11
12
  align?: "left" | "right";
12
13
  };
13
14
  export declare function templateFormatting(source: ICharacter | INumeric, options?: options): string;
@@ -30,7 +30,11 @@ function templateFormatting(source, options) {
30
30
  }
31
31
  else if (source instanceof types_1.Float) {
32
32
  const raw = source.getRaw();
33
- if (Number.isInteger(raw)) {
33
+ if ((options === null || options === void 0 ? void 0 : options.style) === "scientific") {
34
+ text = raw.toExponential().toUpperCase();
35
+ text = text.replace(/([+-])(\d)$/, "$10$2");
36
+ }
37
+ else if (Number.isInteger(raw)) {
34
38
  text = raw.toFixed(0);
35
39
  }
36
40
  else {
@@ -55,6 +55,7 @@ class FieldSymbol {
55
55
  const pt = this.pointer;
56
56
  if (pt instanceof float_1.Float) {
57
57
  const buf = Buffer.allocUnsafe(8);
58
+ // CASTING is platform specific, so perhaps add a setting? But anyhow its not something developers should use
58
59
  buf.writeDoubleLE(pt.getRaw());
59
60
  return buf.toString("hex").toUpperCase();
60
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.7.162",
3
+ "version": "2.7.164",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",