spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Formulas.MAXA written and tested.
author
Ben Vogt <[email protected]>
date
2017-01-22 16:06:48
stats
2 file(s) changed, 12 insertions(+), 1 deletions(-)
files
src/RawFormulas.ts
tests/FormulasTest.ts
 1diff --git a/src/RawFormulas.ts b/src/RawFormulas.ts
 2index 86bf4ee..caeb7ea 100644
 3--- a/src/RawFormulas.ts
 4+++ b/src/RawFormulas.ts
 5@@ -475,7 +475,16 @@ var MAX = function (...values) {
 6   return maxSoFar;
 7 };
 8 
 9-var MAXA = Formula["MAXA"];
10+
11+/**
12+ * Returns the maximum numeric value in a dataset.
13+ * @param values The value(s) or range(s) to consider when calculating the maximum value.
14+ * @returns {number} maximum value of the dataset
15+ * @constructor
16+ */
17+var MAXA = function (...values) : number {
18+  return MAX.apply(this, values);
19+};
20 
21 
22 /**
23diff --git a/tests/FormulasTest.ts b/tests/FormulasTest.ts
24index bfb46cb..6d5d39a 100644
25--- a/tests/FormulasTest.ts
26+++ b/tests/FormulasTest.ts
27@@ -401,7 +401,7 @@ catchAndAssertEquals(function() {
28   MAX(100, "str");
29 }, ERRORS.VALUE_ERROR);
30 
31-
32+// Test MAXA
33 assertEquals(MAXA(100, 22, 44), 100);
34 
35