@gridsheet/react-core 0.12.4-rc.1 → 0.12.4
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/components/Cell.js +185 -197
- package/dist/components/Cell.js.map +1 -1
- package/dist/components/ContextMenu.js +198 -208
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Editor.d.ts.map +1 -1
- package/dist/components/Editor.js +262 -275
- package/dist/components/Editor.js.map +1 -1
- package/dist/components/Emitter.js +29 -39
- package/dist/components/Emitter.js.map +1 -1
- package/dist/components/GridSheet.js +109 -119
- package/dist/components/GridSheet.js.map +1 -1
- package/dist/components/HeaderLeftCell.js +61 -72
- package/dist/components/HeaderLeftCell.js.map +1 -1
- package/dist/components/HeaderTopCell.js +62 -73
- package/dist/components/HeaderTopCell.js.map +1 -1
- package/dist/components/Resizer.js +79 -90
- package/dist/components/Resizer.js.map +1 -1
- package/dist/components/SearchBox.d.ts.map +1 -1
- package/dist/components/SearchBox.js +54 -64
- package/dist/components/SearchBox.js.map +1 -1
- package/dist/components/StoreInitializer.js +71 -81
- package/dist/components/StoreInitializer.js.map +1 -1
- package/dist/components/Tabular.d.ts +2 -2
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/components/Tabular.js +85 -95
- package/dist/components/Tabular.js.map +1 -1
- package/dist/constants.js +26 -36
- package/dist/constants.js.map +1 -1
- package/dist/formula/evaluator.d.ts +1 -1
- package/dist/formula/evaluator.js +490 -500
- package/dist/formula/evaluator.js.map +1 -1
- package/dist/formula/functions/__base.js +17 -27
- package/dist/formula/functions/__base.js.map +1 -1
- package/dist/formula/functions/__utils.js +103 -113
- package/dist/formula/functions/__utils.js.map +1 -1
- package/dist/formula/functions/abs.js +21 -31
- package/dist/formula/functions/abs.js.map +1 -1
- package/dist/formula/functions/abs.spec.js +25 -35
- package/dist/formula/functions/abs.spec.js.map +1 -1
- package/dist/formula/functions/acos.js +28 -38
- package/dist/formula/functions/acos.js.map +1 -1
- package/dist/formula/functions/add.js +47 -57
- package/dist/formula/functions/add.js.map +1 -1
- package/dist/formula/functions/and.js +28 -38
- package/dist/formula/functions/and.js.map +1 -1
- package/dist/formula/functions/asin.js +28 -38
- package/dist/formula/functions/asin.js.map +1 -1
- package/dist/formula/functions/atan.js +26 -36
- package/dist/formula/functions/atan.js.map +1 -1
- package/dist/formula/functions/atan2.js +32 -42
- package/dist/formula/functions/atan2.js.map +1 -1
- package/dist/formula/functions/average.js +40 -50
- package/dist/formula/functions/average.js.map +1 -1
- package/dist/formula/functions/col.js +28 -38
- package/dist/formula/functions/col.js.map +1 -1
- package/dist/formula/functions/concat.js +27 -37
- package/dist/formula/functions/concat.js.map +1 -1
- package/dist/formula/functions/concatenate.js +25 -35
- package/dist/formula/functions/concatenate.js.map +1 -1
- package/dist/formula/functions/cos.js +26 -36
- package/dist/formula/functions/cos.js.map +1 -1
- package/dist/formula/functions/count.js +35 -45
- package/dist/formula/functions/count.js.map +1 -1
- package/dist/formula/functions/counta.js +35 -45
- package/dist/formula/functions/counta.js.map +1 -1
- package/dist/formula/functions/countif.js +30 -40
- package/dist/formula/functions/countif.js.map +1 -1
- package/dist/formula/functions/divide.js +32 -42
- package/dist/formula/functions/divide.js.map +1 -1
- package/dist/formula/functions/eq.js +25 -35
- package/dist/formula/functions/eq.js.map +1 -1
- package/dist/formula/functions/exp.js +28 -38
- package/dist/formula/functions/exp.js.map +1 -1
- package/dist/formula/functions/gt.js +27 -37
- package/dist/formula/functions/gt.js.map +1 -1
- package/dist/formula/functions/gte.js +27 -37
- package/dist/formula/functions/gte.js.map +1 -1
- package/dist/formula/functions/hlookup.js +67 -77
- package/dist/formula/functions/hlookup.js.map +1 -1
- package/dist/formula/functions/if.js +36 -46
- package/dist/formula/functions/if.js.map +1 -1
- package/dist/formula/functions/iferror.js +38 -48
- package/dist/formula/functions/iferror.js.map +1 -1
- package/dist/formula/functions/iferror.spec.js +53 -63
- package/dist/formula/functions/iferror.spec.js.map +1 -1
- package/dist/formula/functions/len.js +26 -36
- package/dist/formula/functions/len.js.map +1 -1
- package/dist/formula/functions/lenb.js +26 -36
- package/dist/formula/functions/lenb.js.map +1 -1
- package/dist/formula/functions/ln.js +28 -38
- package/dist/formula/functions/ln.js.map +1 -1
- package/dist/formula/functions/log.js +33 -43
- package/dist/formula/functions/log.js.map +1 -1
- package/dist/formula/functions/log10.js +28 -38
- package/dist/formula/functions/log10.js.map +1 -1
- package/dist/formula/functions/lt.js +27 -37
- package/dist/formula/functions/lt.js.map +1 -1
- package/dist/formula/functions/lte.js +27 -37
- package/dist/formula/functions/lte.js.map +1 -1
- package/dist/formula/functions/max.js +42 -52
- package/dist/formula/functions/max.js.map +1 -1
- package/dist/formula/functions/min.js +42 -52
- package/dist/formula/functions/min.js.map +1 -1
- package/dist/formula/functions/minus.js +47 -57
- package/dist/formula/functions/minus.js.map +1 -1
- package/dist/formula/functions/mod.js +30 -40
- package/dist/formula/functions/mod.js.map +1 -1
- package/dist/formula/functions/mod.spec.js +47 -57
- package/dist/formula/functions/mod.spec.js.map +1 -1
- package/dist/formula/functions/multiply.js +27 -37
- package/dist/formula/functions/multiply.js.map +1 -1
- package/dist/formula/functions/ne.js +25 -35
- package/dist/formula/functions/ne.js.map +1 -1
- package/dist/formula/functions/not.js +30 -40
- package/dist/formula/functions/not.js.map +1 -1
- package/dist/formula/functions/now.js +21 -31
- package/dist/formula/functions/now.js.map +1 -1
- package/dist/formula/functions/or.js +28 -38
- package/dist/formula/functions/or.js.map +1 -1
- package/dist/formula/functions/pi.js +19 -29
- package/dist/formula/functions/pi.js.map +1 -1
- package/dist/formula/functions/power.js +24 -34
- package/dist/formula/functions/power.js.map +1 -1
- package/dist/formula/functions/product.js +37 -47
- package/dist/formula/functions/product.js.map +1 -1
- package/dist/formula/functions/radians.js +26 -36
- package/dist/formula/functions/radians.js.map +1 -1
- package/dist/formula/functions/rand.js +19 -29
- package/dist/formula/functions/rand.js.map +1 -1
- package/dist/formula/functions/round.js +34 -44
- package/dist/formula/functions/round.js.map +1 -1
- package/dist/formula/functions/rounddown.js +34 -44
- package/dist/formula/functions/rounddown.js.map +1 -1
- package/dist/formula/functions/roundup.js +34 -44
- package/dist/formula/functions/roundup.js.map +1 -1
- package/dist/formula/functions/row.js +28 -38
- package/dist/formula/functions/row.js.map +1 -1
- package/dist/formula/functions/sin.js +26 -36
- package/dist/formula/functions/sin.js.map +1 -1
- package/dist/formula/functions/sqrt.js +28 -38
- package/dist/formula/functions/sqrt.js.map +1 -1
- package/dist/formula/functions/sum.js +42 -52
- package/dist/formula/functions/sum.js.map +1 -1
- package/dist/formula/functions/sum.spec.js +35 -45
- package/dist/formula/functions/sum.spec.js.map +1 -1
- package/dist/formula/functions/sumif.js +56 -66
- package/dist/formula/functions/sumif.js.map +1 -1
- package/dist/formula/functions/tan.js +26 -36
- package/dist/formula/functions/tan.js.map +1 -1
- package/dist/formula/functions/uminus.js +23 -33
- package/dist/formula/functions/uminus.js.map +1 -1
- package/dist/formula/functions/vlookup.js +67 -77
- package/dist/formula/functions/vlookup.js.map +1 -1
- package/dist/formula/mapping.js +116 -126
- package/dist/formula/mapping.js.map +1 -1
- package/dist/formula/solver.js +61 -71
- package/dist/formula/solver.js.map +1 -1
- package/dist/index.js +31 -41
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.js +334 -344
- package/dist/lib/autofill.js.map +1 -1
- package/dist/lib/clipboard.js +45 -55
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/converters.js +130 -140
- package/dist/lib/converters.js.map +1 -1
- package/dist/lib/hooks.d.ts +1 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/hooks.js +2 -0
- package/dist/lib/hooks.js.map +1 -0
- package/dist/lib/structs.js +254 -264
- package/dist/lib/structs.js.map +1 -1
- package/dist/lib/table.d.ts +1 -3
- package/dist/lib/table.d.ts.map +1 -1
- package/dist/lib/table.js +897 -911
- package/dist/lib/table.js.map +1 -1
- package/dist/lib/time.d.ts.map +1 -1
- package/dist/lib/time.js +59 -69
- package/dist/lib/time.js.map +1 -1
- package/dist/lib/virtualization.d.ts +3 -21
- package/dist/lib/virtualization.d.ts.map +1 -1
- package/dist/lib/virtualization.js +115 -125
- package/dist/lib/virtualization.js.map +1 -1
- package/dist/parsers/core.js +109 -119
- package/dist/parsers/core.js.map +1 -1
- package/dist/renderers/checkbox.js +11 -21
- package/dist/renderers/checkbox.js.map +1 -1
- package/dist/renderers/core.d.ts +1 -1
- package/dist/renderers/core.d.ts.map +1 -1
- package/dist/renderers/core.js +129 -139
- package/dist/renderers/core.js.map +1 -1
- package/dist/renderers/thousand_separator.js +15 -25
- package/dist/renderers/thousand_separator.js.map +1 -1
- package/dist/store/actions.d.ts.map +1 -1
- package/dist/store/actions.js +484 -498
- package/dist/store/actions.js.map +1 -1
- package/dist/store/helpers.js +78 -88
- package/dist/store/helpers.js.map +1 -1
- package/dist/store/index.js +5 -15
- package/dist/store/index.js.map +1 -1
- package/dist/styles/embedder.js +17 -27
- package/dist/styles/embedder.js.map +1 -1
- package/dist/styles/minified.js +6 -16
- package/dist/styles/minified.js.map +1 -1
- package/dist/types.d.ts +6 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -12
- package/dist/utils.js +9 -19
- package/dist/utils.js.map +1 -1
- package/package.json +9 -2
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PiFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
class PiFunction extends __base_1.BaseFunction {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.example = "PI()";
|
|
10
|
+
this.helpText = ["Returns the value of pi."];
|
|
11
|
+
this.helpArgs = [];
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PiFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
class PiFunction extends __base_1.BaseFunction {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.example = "PI()";
|
|
19
|
-
this.helpText = ["Returns the value of pi."];
|
|
20
|
-
this.helpArgs = [];
|
|
21
|
-
}
|
|
22
|
-
validate() {
|
|
23
|
-
if (this.bareArgs.length !== 0) {
|
|
24
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for PI is incorrect.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
main() {
|
|
28
|
-
return Math.PI;
|
|
13
|
+
validate() {
|
|
14
|
+
if (this.bareArgs.length !== 0) {
|
|
15
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for PI is incorrect.");
|
|
29
16
|
}
|
|
30
17
|
}
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
main() {
|
|
19
|
+
return Math.PI;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.PiFunction = PiFunction;
|
|
33
23
|
//# sourceMappingURL=pi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AAExC,MAAa,UAAW,SAAQ,qBAAY;IAA5C;;QACE,YAAO,GAAG,MAAM,CAAC;QACjB,aAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;CACF;AAjBD,gCAiBC"}
|
|
@@ -1,38 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PowerFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class PowerFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "POWER(4,0.5)";
|
|
11
|
+
this.helpText = ["Returns a number multiplied by an exponent."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{ name: "base", description: "A number to be multiplied by an exponent." },
|
|
14
|
+
{ name: "exponent", description: "An exponent to power the base." },
|
|
15
|
+
];
|
|
5
16
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.PowerFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class PowerFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "POWER(4,0.5)";
|
|
20
|
-
this.helpText = ["Returns a number multiplied by an exponent."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{ name: "base", description: "A number to be multiplied by an exponent." },
|
|
23
|
-
{ name: "exponent", description: "An exponent to power the base." },
|
|
24
|
-
];
|
|
25
|
-
}
|
|
26
|
-
validate() {
|
|
27
|
-
if (this.bareArgs.length !== 2) {
|
|
28
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for POWER is incorrect.");
|
|
29
|
-
}
|
|
30
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
31
|
-
}
|
|
32
|
-
main(base, exponent) {
|
|
33
|
-
return Math.pow(base, exponent);
|
|
17
|
+
validate() {
|
|
18
|
+
if (this.bareArgs.length !== 2) {
|
|
19
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for POWER is incorrect.");
|
|
34
20
|
}
|
|
21
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
22
|
+
}
|
|
23
|
+
main(base, exponent) {
|
|
24
|
+
return Math.pow(base, exponent);
|
|
35
25
|
}
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
}
|
|
27
|
+
exports.PowerFunction = PowerFunction;
|
|
38
28
|
//# sourceMappingURL=power.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"power.js","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"power.js","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,aAAc,SAAQ,qBAAY;IAA/C;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;YAC1E,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gCAAgC,EAAE;SACpE,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,IAAY,EAAE,QAAgB;QAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;CACF;AArBD,sCAqBC"}
|
|
@@ -1,51 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductFunction = void 0;
|
|
4
|
+
const solver_1 = require("../solver");
|
|
5
|
+
const table_1 = require("../../lib/table");
|
|
6
|
+
const __base_1 = require("./__base");
|
|
7
|
+
const __utils_1 = require("./__utils");
|
|
8
|
+
class ProductFunction extends __base_1.BaseFunction {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.example = "PRODUCT(A2:A100)";
|
|
12
|
+
this.helpText = ["Returns the product of a series of numbers or cells."];
|
|
13
|
+
this.helpArgs = [
|
|
14
|
+
{ name: "value1", description: "First number or range." },
|
|
15
|
+
{
|
|
16
|
+
name: "value2",
|
|
17
|
+
description: "Additional numbers or ranges",
|
|
18
|
+
optional: true,
|
|
19
|
+
iterable: true,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
validate() {
|
|
24
|
+
const spreaded = [];
|
|
25
|
+
this.bareArgs.forEach((arg) => {
|
|
26
|
+
if (arg instanceof table_1.Table) {
|
|
27
|
+
spreaded.push(...(0, solver_1.solveTable)({ table: arg })
|
|
28
|
+
.reduce((a, b) => a.concat(b))
|
|
29
|
+
.filter((v) => typeof v === "number"));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
33
|
+
});
|
|
34
|
+
this.bareArgs = spreaded;
|
|
8
35
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ProductFunction = void 0;
|
|
13
|
-
const solver_1 = require("../solver");
|
|
14
|
-
const table_1 = require("../../lib/table");
|
|
15
|
-
const __base_1 = require("./__base");
|
|
16
|
-
const __utils_1 = require("./__utils");
|
|
17
|
-
class ProductFunction extends __base_1.BaseFunction {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.example = "PRODUCT(A2:A100)";
|
|
21
|
-
this.helpText = ["Returns the product of a series of numbers or cells."];
|
|
22
|
-
this.helpArgs = [
|
|
23
|
-
{ name: "value1", description: "First number or range." },
|
|
24
|
-
{
|
|
25
|
-
name: "value2",
|
|
26
|
-
description: "Additional numbers or ranges",
|
|
27
|
-
optional: true,
|
|
28
|
-
iterable: true,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
validate() {
|
|
33
|
-
const spreaded = [];
|
|
34
|
-
this.bareArgs.forEach((arg) => {
|
|
35
|
-
if (arg instanceof table_1.Table) {
|
|
36
|
-
spreaded.push(...(0, solver_1.solveTable)({ table: arg })
|
|
37
|
-
.reduce((a, b) => a.concat(b))
|
|
38
|
-
.filter((v) => typeof v === "number"));
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
42
|
-
});
|
|
43
|
-
this.bareArgs = spreaded;
|
|
44
|
-
}
|
|
45
|
-
main(...values) {
|
|
46
|
-
return values.reduce((a, b) => a * b);
|
|
47
|
-
}
|
|
36
|
+
main(...values) {
|
|
37
|
+
return values.reduce((a, b) => a * b);
|
|
48
38
|
}
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
}
|
|
40
|
+
exports.ProductFunction = ProductFunction;
|
|
51
41
|
//# sourceMappingURL=product.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,2CAAwC;AACxC,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,eAAgB,SAAQ,qBAAY;IAAjD;;QACE,YAAO,GAAG,kBAAkB,CAAC;QAC7B,aAAQ,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACzD;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAqBJ,CAAC;IAnBW,QAAQ;QAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,IAAI,GAAG,YAAY,aAAK,EAAE;gBACxB,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;qBAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAC7C,CAAC;gBACF,OAAO;aACR;YACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,IAAI,CAAC,GAAG,MAAgB;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;CACF;AAhCD,0CAgCC"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RadiansFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class RadiansFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "RADIANS(180)";
|
|
11
|
+
this.helpText = ["Converts an angle from degrees to radians."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "angle",
|
|
15
|
+
description: "The angle to convert from degrees to radians.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RadiansFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class RadiansFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "RADIANS(180)";
|
|
20
|
-
this.helpText = ["Converts an angle from degrees to radians."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "angle",
|
|
24
|
-
description: "The angle to convert from degrees to radians.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RADIANS is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
33
|
-
}
|
|
34
|
-
main(angle) {
|
|
35
|
-
return (angle / 180) * Math.PI;
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RADIANS is incorrect.");
|
|
36
22
|
}
|
|
23
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
24
|
+
}
|
|
25
|
+
main(angle) {
|
|
26
|
+
return (angle / 180) * Math.PI;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}
|
|
29
|
+
exports.RadiansFunction = RadiansFunction;
|
|
40
30
|
//# sourceMappingURL=radians.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radians.js","sourceRoot":"","sources":["../../../src/formula/functions/radians.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"radians.js","sourceRoot":"","sources":["../../../src/formula/functions/radians.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,eAAgB,SAAQ,qBAAY;IAAjD;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG,CAAC,4CAA4C,CAAC,CAAC;QAC1D,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+CAA+C;aAC7D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;IACjC,CAAC;CACF;AAvBD,0CAuBC"}
|
|
@@ -1,33 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RandFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
class RandFunction extends __base_1.BaseFunction {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.example = "RAND()";
|
|
10
|
+
this.helpText = ["Returns a random number between 0 and 1."];
|
|
11
|
+
this.helpArgs = [];
|
|
5
12
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RandFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
class RandFunction extends __base_1.BaseFunction {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.example = "RAND()";
|
|
19
|
-
this.helpText = ["Returns a random number between 0 and 1."];
|
|
20
|
-
this.helpArgs = [];
|
|
21
|
-
}
|
|
22
|
-
validate() {
|
|
23
|
-
if (this.bareArgs.length !== 0) {
|
|
24
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RAND is incorrect.");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
main() {
|
|
28
|
-
return Math.random();
|
|
13
|
+
validate() {
|
|
14
|
+
if (this.bareArgs.length !== 0) {
|
|
15
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RAND is incorrect.");
|
|
29
16
|
}
|
|
30
17
|
}
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
main() {
|
|
19
|
+
return Math.random();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.RandFunction = RandFunction;
|
|
33
23
|
//# sourceMappingURL=rand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rand.js","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rand.js","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AAExC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,QAAQ,CAAC;QACnB,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF;AAjBD,oCAiBC"}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoundFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class RoundFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ROUND(99.44,1)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Round a number to the specified number of decimal places according to standard rules.",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
description: "A number to be rounded.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "digit",
|
|
21
|
+
description: "The number of decimal places after rounding.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
5
25
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RoundFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class RoundFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ROUND(99.44,1)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Round a number to the specified number of decimal places according to standard rules.",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{
|
|
25
|
-
name: "value",
|
|
26
|
-
description: "A number to be rounded.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "digit",
|
|
30
|
-
description: "The number of decimal places after rounding.",
|
|
31
|
-
optional: true,
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
validate() {
|
|
36
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
37
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUND is incorrect.");
|
|
38
|
-
}
|
|
39
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
40
|
-
}
|
|
41
|
-
main(value, digit = 0) {
|
|
42
|
-
const multiplier = Math.pow(10, digit);
|
|
43
|
-
return Math.round(value * multiplier) / multiplier;
|
|
26
|
+
validate() {
|
|
27
|
+
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
28
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUND is incorrect.");
|
|
44
29
|
}
|
|
30
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
31
|
+
}
|
|
32
|
+
main(value, digit = 0) {
|
|
33
|
+
const multiplier = Math.pow(10, digit);
|
|
34
|
+
return Math.round(value * multiplier) / multiplier;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
}
|
|
37
|
+
exports.RoundFunction = RoundFunction;
|
|
48
38
|
//# sourceMappingURL=round.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"round.js","sourceRoot":"","sources":["../../../src/formula/functions/round.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"round.js","sourceRoot":"","sources":["../../../src/formula/functions/round.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,aAAc,SAAQ,qBAAY;IAA/C;;QACE,YAAO,GAAG,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,uFAAuF;SACxF,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,yBAAyB;aACvC;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF;AA/BD,sCA+BC"}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RounddownFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class RounddownFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ROUNDDOWN(99.44,1)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Round down a number to the specified number of decimal places according to standard rules.",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
description: "A number to be rounded down.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "digit",
|
|
21
|
+
description: "The number of decimal places after rounding.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
5
25
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RounddownFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class RounddownFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ROUNDDOWN(99.44,1)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Round down a number to the specified number of decimal places according to standard rules.",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{
|
|
25
|
-
name: "value",
|
|
26
|
-
description: "A number to be rounded down.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "digit",
|
|
30
|
-
description: "The number of decimal places after rounding.",
|
|
31
|
-
optional: true,
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
validate() {
|
|
36
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
37
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDDOWN is incorrect.");
|
|
38
|
-
}
|
|
39
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
40
|
-
}
|
|
41
|
-
main(value, digit = 0) {
|
|
42
|
-
const multiplier = Math.pow(10, digit);
|
|
43
|
-
return Math.floor(value * multiplier) / multiplier;
|
|
26
|
+
validate() {
|
|
27
|
+
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
28
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDDOWN is incorrect.");
|
|
44
29
|
}
|
|
30
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
31
|
+
}
|
|
32
|
+
main(value, digit = 0) {
|
|
33
|
+
const multiplier = Math.pow(10, digit);
|
|
34
|
+
return Math.floor(value * multiplier) / multiplier;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
}
|
|
37
|
+
exports.RounddownFunction = RounddownFunction;
|
|
48
38
|
//# sourceMappingURL=rounddown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rounddown.js","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rounddown.js","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,iBAAkB,SAAQ,qBAAY;IAAnD;;QACE,YAAO,GAAG,oBAAoB,CAAC;QAC/B,aAAQ,GAAG;YACT,4FAA4F;SAC7F,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8BAA8B;aAC5C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,iDAAiD,CAClD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF;AA/BD,8CA+BC"}
|
|
@@ -1,48 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoundupFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class RoundupFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ROUNDUP(99.44,1)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Round up a number to the specified number of decimal places according to standard rules.",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
description: "A number to be rounded up.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "digit",
|
|
21
|
+
description: "The number of decimal places after rounding.",
|
|
22
|
+
optional: true,
|
|
23
|
+
},
|
|
24
|
+
];
|
|
5
25
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.RoundupFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class RoundupFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ROUNDUP(99.44,1)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Round up a number to the specified number of decimal places according to standard rules.",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{
|
|
25
|
-
name: "value",
|
|
26
|
-
description: "A number to be rounded up.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "digit",
|
|
30
|
-
description: "The number of decimal places after rounding.",
|
|
31
|
-
optional: true,
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
validate() {
|
|
36
|
-
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
37
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDUP is incorrect.");
|
|
38
|
-
}
|
|
39
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
40
|
-
}
|
|
41
|
-
main(value, digit = 0) {
|
|
42
|
-
const multiplier = Math.pow(10, digit);
|
|
43
|
-
return Math.ceil(value * multiplier) / multiplier;
|
|
26
|
+
validate() {
|
|
27
|
+
if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
|
|
28
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDUP is incorrect.");
|
|
44
29
|
}
|
|
30
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
31
|
+
}
|
|
32
|
+
main(value, digit = 0) {
|
|
33
|
+
const multiplier = Math.pow(10, digit);
|
|
34
|
+
return Math.ceil(value * multiplier) / multiplier;
|
|
45
35
|
}
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
}
|
|
37
|
+
exports.RoundupFunction = RoundupFunction;
|
|
48
38
|
//# sourceMappingURL=roundup.js.map
|