@xylabs/decimal-precision 2.12.8 → 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.
package/dist/browser/index.cjs
CHANGED
|
@@ -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
|
-
|
|
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":"
|
|
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":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,UAAW,MAAM,UAAU,MAAM,WAO/D,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,UAAW,MAAM,UAAU,MAAM,WAO/D,CAAA"}
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"exports": {
|
|
16
16
|
".": {
|
|
17
17
|
"require": {
|
|
18
|
-
"types": "./dist/node/index.d.
|
|
18
|
+
"types": "./dist/node/index.d.cts",
|
|
19
19
|
"default": "./dist/node/index.cjs"
|
|
20
20
|
},
|
|
21
21
|
"import": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"esm"
|
|
40
40
|
],
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^3.0.
|
|
43
|
-
"@xylabs/tsconfig": "^3.0.
|
|
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.
|
|
54
|
+
"version": "2.12.10",
|
|
55
55
|
"type": "module"
|
|
56
56
|
}
|