Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
63b1d5b7
Commit
63b1d5b7
authored
7 years ago
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some tests for GROWTH
parent
b919814d
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+33
-0
No files found.
cell/.unit-tests/FormulaTests.js
View file @
63b1d5b7
...
...
@@ -9114,6 +9114,39 @@ $( function () {
oParser
=
new
parserFormula
(
"
GROWTH(B102:B107,A102:A107)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
5
)
-
0
,
32618.20377
);
oParser
=
new
parserFormula
(
"
GROWTH(A102:C102,A103:C104,A105:C106,1)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
11.00782679
);
oParser
=
new
parserFormula
(
"
GROWTH(A102:C102,A103:C104,A105:C106,1)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
11.00782679
);
oParser
=
new
parserFormula
(
"
GROWTH(A103:C103,A104:C105,A106:C107,1)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
12.00187209
);
oParser
=
new
parserFormula
(
"
GROWTH(A103:C103,A104:C105,A106:C107,10)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
12.00187209
);
oParser
=
new
parserFormula
(
"
GROWTH(A103:C103,A104:C105,A106:C107,0)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
1.0017632
);
oParser
=
new
parserFormula
(
"
GROWTH({1,2,3},A104:C105,A106:C107,1)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
().
toFixed
(
8
)
-
0
,
1.00038318
);
oParser
=
new
parserFormula
(
"
GROWTH({1,2,3},A104:C105,A106:C107,A106:C107)
"
,
"
A2
"
,
ws
);
ok
(
oParser
.
parse
()
);
strictEqual
(
oParser
.
calculate
().
getValue
(),
"
#VALUE!
"
);
/*oParser = new parserFormula( "GROWTH({3,4,5,6,7})", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue().toFixed(8) - 0, 3.14681449);*/
}
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment