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
6c1365db
Commit
6c1365db
authored
Apr 12, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cell/model/FormulaObjects/dateandtimeFunctions to function-closure
parent
e80e7a7a
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
68 deletions
+82
-68
cell/.unit-tests/FormulaTests.js
cell/.unit-tests/FormulaTests.js
+28
-28
cell/model/FormulaObjects/dateandtimeFunctions.js
cell/model/FormulaObjects/dateandtimeFunctions.js
+16
-2
cell/model/FormulaObjects/financialFunctions.js
cell/model/FormulaObjects/financialFunctions.js
+38
-38
No files found.
cell/.unit-tests/FormulaTests.js
View file @
6c1365db
...
...
@@ -3888,7 +3888,7 @@ $( function () {
if
(
settlement
>=
maturity
||
pr
<=
0
||
redemption
<=
0
||
basis
<
0
||
basis
>
4
)
return
"
#NUM!
"
return
(
1.0
-
pr
/
redemption
)
/
yearFrac
(
settlement
,
maturity
,
basis
);
return
(
1.0
-
pr
/
redemption
)
/
AscCommonExcel
.
yearFrac
(
settlement
,
maturity
,
basis
);
}
...
...
@@ -3967,7 +3967,7 @@ $( function () {
if
(
settlement
>=
maturity
||
investment
<=
0
||
discount
<=
0
||
basis
<
0
||
basis
>
4
)
return
"
#NUM!
"
return
investment
/
(
1
-
(
discount
*
yearFrac
(
settlement
,
maturity
,
basis
)
)
)
return
investment
/
(
1
-
(
discount
*
AscCommonExcel
.
yearFrac
(
settlement
,
maturity
,
basis
)
)
)
}
...
...
@@ -4084,7 +4084,7 @@ $( function () {
if
(
settlement
>=
maturity
||
investment
<=
0
||
redemption
<=
0
||
basis
<
0
||
basis
>
4
)
return
"
#NUM!
"
return
(
(
redemption
/
investment
)
-
1
)
/
yearFrac
(
settlement
,
maturity
,
basis
)
return
(
(
redemption
/
investment
)
-
1
)
/
AscCommonExcel
.
yearFrac
(
settlement
,
maturity
,
basis
)
}
...
...
@@ -4128,7 +4128,7 @@ $( function () {
var
d1
=
settlement
var
d2
=
maturity
var
fFraction
=
yearFrac
(
d1
,
d2
,
0
);
var
fFraction
=
AscCommonExcel
.
yearFrac
(
d1
,
d2
,
0
);
if
(
fFraction
-
Math
.
floor
(
fFraction
)
==
0
)
return
"
#NUM!
"
...
...
cell/model/FormulaObjects/dateandtimeFunctions.js
View file @
6c1365db
...
...
@@ -23,7 +23,12 @@
*
*/
"
use strict
"
;
(
/**
* @param {Window} window
* @param {undefined} undefined
*/
function
(
window
,
undefined
)
{
var
DayCountBasis
=
{
// US 30/360
UsPsa30_360
:
0
,
...
...
@@ -1910,3 +1915,12 @@ cYEARFRAC.prototype.getInfo = function () {
args
:
"
( start-date , end-date [ , basis ] )
"
};
}
//----------------------------------------------------------export----------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
'
AscCommonExcel
'
].
DayCountBasis
=
DayCountBasis
;
window
[
'
AscCommonExcel
'
].
yearFrac
=
yearFrac
;
window
[
'
AscCommonExcel
'
].
diffDate
=
diffDate
;
window
[
'
AscCommonExcel
'
].
days360
=
days360
;
window
[
'
AscCommonExcel
'
].
daysInYear
=
daysInYear
;
})(
window
);
cell/model/FormulaObjects/financialFunctions.js
View file @
6c1365db
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