Commit 9bcc6007 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fixed:

Bug 24770 - Функция RATE рассчитывается без обязательных аргументов Nper/Pmt
Bug 24752 - Неверно задана область определения аргумента Rate/Yld для функции PRICEMAT
Bug 24728 - [XLSX] Таблица открывается с ошибкой в консоли undefined is not a function

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56649 954022d7-b5bf-4e40-9824-e11837661b57
parent 9334951b
......@@ -163,7 +163,7 @@ function RateIteration( nper, payment, pv, fv, payType, guess ) {
return new cNumber( x );
}
else{
return new cError( cErrorType.wrong_value_type );
return new cError( cErrorType.not_numeric );
}
}
......@@ -4576,7 +4576,7 @@ cPRICEMAT.prototype.Calculate = function ( arg ) {
if ( settlement >= maturity ||
basis < 0 || basis > 4 ||
rate <= 0 || yld <= 0 )
rate < 0 || yld < 0 )
return this.value = new cError( cErrorType.not_numeric );
var settl = Date.prototype.getDateFromExcel( settlement ),
......@@ -4712,7 +4712,10 @@ function cRATE() {
cRATE.prototype = Object.create( cBaseFunction.prototype );
cRATE.prototype.Calculate = function ( arg ) {
var nper = arg[0], pmt = arg[1], pv = arg[2], fv = arg[3] ? arg[3] : new cNumber( 0 ), type = arg[4] ? arg[4] : new cNumber( 0 ), quess = arg[5] ? arg[5] : new cNumber( 0.1 );
var nper = arg[0], pmt = arg[1], pv = arg[2],
fv = arg[3] ? arg[3] : new cNumber( 0 ),
type = arg[4] ? arg[4] : new cNumber( 0 ),
quess = arg[5] ? arg[5] : new cNumber( 0.1 );
if ( nper instanceof cArea || nper instanceof cArea3D ) {
nper = nper.cross( arguments[1].first );
......@@ -4770,9 +4773,16 @@ cRATE.prototype.Calculate = function ( arg ) {
if ( type instanceof cError ) return this.value = type;
if ( quess instanceof cError ) return this.value = quess;
if ( type.getValue() != 1 && type.getValue() != 0 ) return this.value = new cError( cErrorType.not_numeric );
nper = nper.getValue();
pmt = pmt.getValue();
pv = pv.getValue();
fv = fv.getValue();
type = type.getValue();
quess = quess.getValue();
if ( type != 1 && type != 0 || nper <= 0 || pmt >= 0 ) return this.value = new cError( cErrorType.not_numeric );
this.value = new cNumber( RateIteration( nper.getValue(), pmt.getValue(), pv.getValue(), fv.getValue(), type.getValue(), quess.getValue() ) );
this.value = new cNumber( RateIteration( nper, pmt, pv, fv, type, quess ) );
this.value.numFormat = 9;
return this.value;
};
......
......@@ -1639,9 +1639,10 @@ cFREQUENCY.prototype.getInfo = function () {
function cFTEST() {
cBaseFunction.call( this, "FTEST" );
cFTEST.prototype = Object.create( cBaseFunction.prototype )
}
cFTEST.prototype = Object.create( cBaseFunction.prototype )
function cGAMMADIST() {
cBaseFunction.call( this, "GAMMADIST" );
}
......
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