Skip to content
This repository was archived by the owner on Jul 15, 2021. It is now read-only.

Commit 8f8a68b

Browse files
committed
Added: EXP formula support. #27
1 parent d7adcbd commit 8f8a68b

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
"webpack": "^2.0.0"
8282
},
8383
"dependencies": {
84-
"formulajs": "github:handsontable/formula.js#1.0.6",
84+
"formulajs": "github:handsontable/formula.js#1.2.0",
8585
"tiny-emitter": "^1.0.2"
8686
},
8787
"jest": {

src/supported-formulas.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ const SUPPORTED_FORMULAS = [
108108
'ERFC',
109109
'EVEN',
110110
'EXACT',
111+
'EXP',
111112
'EXPON.DIST',
112113
'EXPONDIST',
113114
'F.DIST',

test/integration/parsing/formula/math-trig.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,14 @@ describe('.parse() math-trig formulas', () => {
224224
expect(parser.parse('EQ(12.2, 12.3)')).toMatchObject({error: null, result: false});
225225
});
226226

227+
it('EXP', () => {
228+
expect(parser.parse('EXP()')).toMatchObject({error: '#N/A', result: null});
229+
expect(parser.parse('EXP(MY_VAR)')).toMatchObject({error: '#NAME?', result: null});
230+
expect(parser.parse('EXP("1")')).toMatchObject({error: '#ERROR!', result: null});
231+
expect(parser.parse('EXP(1, 1)')).toMatchObject({error: '#ERROR!', result: null});
232+
expect(parser.parse('EXP(1)')).toMatchObject({error: null, result: 2.718281828459045});
233+
});
234+
227235
it('FACT', () => {
228236
expect(parser.parse('FACT()')).toMatchObject({error: '#VALUE!', result: null});
229237
expect(parser.parse('FACT("value")')).toMatchObject({error: '#VALUE!', result: null});

test/unit/supported-formulas.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import SUPPORTED_FORMULAS from '../../src/supported-formulas';
22

33
describe('.SUPPORTED_FORMULAS', () => {
44
it('should be defined', () => {
5-
expect(SUPPORTED_FORMULAS.length).toBe(389);
5+
expect(SUPPORTED_FORMULAS.length).toBe(390);
66
});
77
});

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,9 +1716,9 @@ form-data@~2.1.1:
17161716
combined-stream "^1.0.5"
17171717
mime-types "^2.1.12"
17181718

1719-
"formulajs@github:handsontable/formula.js#1.0.6":
1720-
version "1.0.6"
1721-
resolved "https://codeload.github.com/handsontable/formula.js/tar.gz/5ab1300324b07a0cf42970fbe74c0a186333f8e9"
1719+
"formulajs@github:handsontable/formula.js#1.2.0":
1720+
version "1.2.0"
1721+
resolved "https://codeload.github.com/handsontable/formula.js/tar.gz/5e21c93bad1c37c3baf2a8e5fad4d080725159ba"
17221722
dependencies:
17231723
bessel "^0.2.0"
17241724
jStat "^1.5.3"

0 commit comments

Comments
 (0)