Commit 6c1365db authored by Alexander.Trofimov's avatar Alexander.Trofimov

cell/model/FormulaObjects/dateandtimeFunctions to function-closure

parent e80e7a7a
......@@ -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!"
......
......@@ -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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment