@xylabs/decimal-precision 2.12.9 → 2.12.10

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.
@@ -16,12 +16,14 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
19
21
  var src_exports = {};
20
22
  __export(src_exports, {
21
23
  toDecimalPrecision: () => toDecimalPrecision
22
24
  });
23
25
  module.exports = __toCommonJS(src_exports);
24
- const toDecimalPrecision = (value, digits) => {
26
+ var toDecimalPrecision = (value, digits) => {
25
27
  let fixed = 0;
26
28
  const result = parseFloat(value.toPrecision(digits));
27
29
  while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export const toDecimalPrecision = (value: number, digits: number) => {\n let fixed = 0\n const result = parseFloat(value.toPrecision(digits))\n while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {\n fixed++\n }\n return result.toFixed(fixed)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,qBAAqB,CAAC,OAAe,WAAmB;AACnE,MAAI,QAAQ;AACZ,QAAM,SAAS,WAAW,MAAM,YAAY,MAAM,CAAC;AACnD,SAAO,WAAW,OAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,QAAQ,IAAI;AACjE;AAAA,EACF;AACA,SAAO,OAAO,QAAQ,KAAK;AAC7B;","names":[]}
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export const toDecimalPrecision = (value: number, digits: number) => {\n let fixed = 0\n const result = parseFloat(value.toPrecision(digits))\n while (parseFloat(result.toFixed(fixed)) !== result && fixed < 20) {\n fixed++\n }\n return result.toFixed(fixed)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,qBAAqB,CAAC,OAAe,WAAmB;AACnE,MAAI,QAAQ;AACZ,QAAM,SAAS,WAAW,MAAM,YAAY,MAAM,CAAC;AACnD,SAAO,WAAW,OAAO,QAAQ,KAAK,CAAC,MAAM,UAAU,QAAQ,IAAI;AACjE;AAAA,EACF;AACA,SAAO,OAAO,QAAQ,KAAK;AAC7B;","names":[]}
package/package.json CHANGED
@@ -39,8 +39,8 @@
39
39
  "esm"
40
40
  ],
41
41
  "devDependencies": {
42
- "@xylabs/ts-scripts-yarn3": "^3.0.75",
43
- "@xylabs/tsconfig": "^3.0.75",
42
+ "@xylabs/ts-scripts-yarn3": "^3.0.76",
43
+ "@xylabs/tsconfig": "^3.0.76",
44
44
  "typescript": "^5.2.2"
45
45
  },
46
46
  "publishConfig": {
@@ -51,6 +51,6 @@
51
51
  "url": "https://github.com/xylabs/sdk-js.git"
52
52
  },
53
53
  "sideEffects": false,
54
- "version": "2.12.9",
54
+ "version": "2.12.10",
55
55
  "type": "module"
56
56
  }