spreadsheet
typeScript/javascript spreadsheet parser, with formulas.
git clone https://git.vogt.world/spreadsheet.git
Log | Files | README.md
← Commit log
commit
message
Removing unused formulas
author
Ben Vogt <[email protected]>
date
2017-02-18 18:14:11
stats
4 file(s) changed, 4 insertions(+), 27 deletions(-)
files
src/Formulas.ts
src/RawFormulas/RawFormulas.ts
tests/FormulasTest.ts
tests/SheetFormulaTest.ts
  1diff --git a/src/Formulas.ts b/src/Formulas.ts
  2index 095733b..7eee42c 100644
  3--- a/src/Formulas.ts
  4+++ b/src/Formulas.ts
  5@@ -4,8 +4,8 @@ import * as RawFormulas from "./RawFormulas/RawFormulas";
  6 const SUPPORTED_FORMULAS = [
  7   'ABS', 'ACCRINT', 'ACOS', 'ACOSH', 'ACOTH', 'AND', 'ARABIC', 'ASIN', 'ASINH', 'ATAN', 'ATAN2', 'ATANH', 'AVEDEV', 'AVERAGE', 'AVERAGEA', 'AVERAGEIF',
  8   'BIN2DEC', 'BIN2HEX', 'BIN2OCT', 'BINOMDIST',
  9-  'CEILING', 'CHAR', 'CODE', 'COMBIN', 'COMBINA', 'COMPLEX', 'CONCATENATE', 'CONFIDENCE', 'CONVERT', 'CORREL', 'COS', 'COSH', 'COT', 'COTH', 'COUNT', 'COUNTA', 'COUNTBLANK', 'COUNTIF', 'COUNTIFS', 'COUNTUNIQUE', 'COVARIANCEP', 'COVARIANCES', 'CSC', 'CSCH', 'CUMIPMT', 'CUMPRINC',
 10-  'DATE', 'DATEVALUE', 'DAY', 'DAYS', 'DAYS360', 'DB', 'DDB', 'DEC2BIN', 'DEC2HEX', 'DEC2OCT', 'DECIMAL', 'DEGREES', 'DELTA', 'DEVSQ', 'DOLLAR', 'DOLLARDE', 'DOLLARFR',
 11+  'CEILING', 'CHAR', 'CODE', 'COMBIN', 'COMBINA', 'COMPLEX', 'CONCATENATE', 'CONFIDENCE', 'CONVERT', 'CORREL', 'COS', 'COSH', 'COT', 'COTH', 'COUNT', 'COUNTA', 'COUNTBLANK', 'COUNTIF', 'COUNTIFS', 'COUNTUNIQUE', 'COVARIANCEP', 'COVARIANCES', 'CUMIPMT', 'CUMPRINC',
 12+  'DATE', 'DATEVALUE', 'DAY', 'DAYS', 'DAYS360', 'DB', 'DDB', 'DEC2BIN', 'DEC2HEX', 'DEC2OCT', 'DEGREES', 'DELTA', 'DEVSQ', 'DOLLAR', 'DOLLARDE', 'DOLLARFR',
 13   'E', 'EDATE', 'EFFECT', 'EOMONTH', 'ERF', 'ERFC', 'EVEN', 'EXACT', 'EXPONDIST',
 14   'FALSE', 'FDIST', 'FINV', 'FISHER', 'FISHERINV',
 15   'IF', 'INT', 'ISEVEN', 'ISODD',
 16diff --git a/src/RawFormulas/RawFormulas.ts b/src/RawFormulas/RawFormulas.ts
 17index 459de63..87c377d 100644
 18--- a/src/RawFormulas/RawFormulas.ts
 19+++ b/src/RawFormulas/RawFormulas.ts
 20@@ -83,15 +83,12 @@ import * as ERRORS from "../Errors"
 21 import {Cell} from "../Cell";
 22 
 23 var ACCRINT = Formula["ACCRINT"];
 24-var DECIMAL = Formula["DECIMAL"];
 25 var COMBIN = Formula["COMBIN"];
 26 var CONVERT = Formula["CONVERT"];
 27 var CORREL = Formula["CORREL"];
 28 var COUNTUNIQUE = Formula["COUNTUNIQUE"];
 29 var COVARIANCEP = Formula["COVARIANCEP"];
 30 var COVARIANCES = Formula["COVARIANCES"];
 31-var CSC = Formula["CSC"];
 32-var CSCH = Formula["CSCH"];
 33 var CUMIPMT = Formula["CUMIPMT"];
 34 var CUMPRINC = Formula["CUMPRINC"];
 35 var DATE = Formula["DATE"];
 36@@ -479,7 +476,6 @@ export {
 37   BIN2DEC,
 38   BIN2HEX,
 39   BIN2OCT,
 40-  DECIMAL,
 41   CEILING,
 42   CHAR,
 43   CODE,
 44@@ -499,8 +495,6 @@ export {
 45   COUNTUNIQUE,
 46   COVARIANCEP,
 47   COVARIANCES,
 48-  CSC,
 49-  CSCH,
 50   CUMIPMT,
 51   CUMPRINC,
 52   DATE,
 53diff --git a/tests/FormulasTest.ts b/tests/FormulasTest.ts
 54index 008c09e..5f04d68 100644
 55--- a/tests/FormulasTest.ts
 56+++ b/tests/FormulasTest.ts
 57@@ -1,8 +1,8 @@
 58 import { ABS, ACCRINT, ACOS, ACOSH, ACOTH, AND, ARABIC, ASIN, ASINH, ATAN, ATAN2, ATANH, AVEDEV, AVERAGE,
 59-    AVERAGEA, AVERAGEIF, BIN2DEC, BIN2HEX, BIN2OCT, DECIMAL, CEILING,
 60+    AVERAGEA, AVERAGEIF, BIN2DEC, BIN2HEX, BIN2OCT, CEILING,
 61     CHAR, CODE, COMBIN, CONCATENATE, CONVERT,
 62     CORREL, COS, PI, COSH, COT, COTH, COUNT, COUNTA, COUNTIF, COUNTIFS, COUNTUNIQUE,
 63-    COVARIANCEP, COVARIANCES, CSC, CSCH, CUMIPMT, CUMPRINC, DATE, DATEVALUE, DAY, DAYS, DAYS360,
 64+    COVARIANCEP, COVARIANCES, CUMIPMT, CUMPRINC, DATE, DATEVALUE, DAY, DAYS, DAYS360,
 65     DB, DDB, DEC2BIN, DEC2HEX, DEC2OCT, DEGREES, DELTA, DEVSQ, DOLLAR, DOLLARDE, DOLLARFR, EDATE,
 66     EFFECT, EOMONTH, ERF, ERFC, EVEN, EXACT, EXPONDIST, FALSE, FLOOR, __COMPLEX, FISHER, FISHERINV, IF,
 67     INT, ISEVEN, ISODD, LN, LOG, LOG10, MAX, MAXA, MEDIAN, MIN, MINA, MOD, NOT, TRUE, ODD, OR,
 68@@ -356,8 +356,6 @@ catchAndAssertEquals(function() {
 69 }, ERRORS.NA_ERROR);
 70 
 71 
 72-assertEquals(DECIMAL(199.99999), 199);
 73-
 74 // Test CEILING
 75 assertEquals(CEILING(10.1), 11);
 76 assertEquals(CEILING("10.1"), 11);
 77@@ -643,10 +641,6 @@ assertEquals(COVARIANCEP([3,2,4,5,6], [9,7,12,15,17]), 5.2);
 78 
 79 assertEquals(COVARIANCES([2,4,8], [5,11,12]), 9.666666666666668);
 80 
 81-assertEquals(CSC(15), 1.5377805615408537);
 82-
 83-assertEquals(CSCH(1.5), 0.46964244059522464);
 84-
 85 assertEquals(CUMIPMT(0.12, 12, 100, 1, 5, 0), -54.39423242396348);
 86 
 87 assertEquals(CUMPRINC(0.12, 12, 100, 1, 5, 0), -26.324171373034403);
 88diff --git a/tests/SheetFormulaTest.ts b/tests/SheetFormulaTest.ts
 89index ded4855..3a23768 100644
 90--- a/tests/SheetFormulaTest.ts
 91+++ b/tests/SheetFormulaTest.ts
 92@@ -93,9 +93,6 @@ testFormula("=BIN2HEX(1010101010)", "FFFFFFFEAA");
 93 // Test BIN2OCT
 94 testFormula("=BIN2OCT(1010101010)", "7777777252");
 95 
 96-// Test DECIMAL
 97-testFormula('=DECIMAL(199.99999)', 199);
 98-
 99 // Test BINOMDIST
100 // TODO: This. FormulaJS implementation differs from GS.
101 
102@@ -160,12 +157,6 @@ testFormula('=COVARIANCEP([3,2,4,5,6], [9,7,12,15,17])', 5.2);
103 // Test COVARIANCES
104 testFormula('=COVARIANCES([2,4,8], [5,11,12])', 9.666666666666668);
105 
106-// Test CSC
107-testFormula('=CSC(15)', 1.5377805615408537);
108-
109-// Test CSCH
110-testFormula('=CSCH(1.5)', 0.46964244059522464);
111-
112 // Test CUMIPMT
113 testFormula("=CUMIPMT(0.12, 12, 100, 1, 5, 0)", -54.39423242396348);
114