Commit 5a7a1584 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix: Bug 21559 - Не рассчитывается функция NPER

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50954 954022d7-b5bf-4e40-9824-e11837661b57
parent d3afab46
......@@ -248,10 +248,16 @@ cFormulaFunction.Financial = {
var res;
if ( rate.getValue() != 0 ) {
res = -1 * ( fv.getValue() + pmt.getValue() * (1 + rate.getValue() * type.getValue()) * ( (Math.pow( (1 + rate.getValue()), nper.getValue() ) - 1) / rate.getValue() ) ) / Math.pow( 1 + rate.getValue(), nper.getValue() )
rate = rate.getValue();
pmt = pmt.getValue();
pv = pv.getValue();
fv = fv.getValue();
type = type.getValue();
res = (-fv * rate + pmt * (1 + rate * type)) / (rate * pv + pmt * (1 + rate * type))
res = Math.log( res ) / Math.log( 1+rate )
}
else {
res = -1 * ( fv.getValue() + pmt.getValue() * pmt.getValue() );
res = - pv.getValue() - fv.getValue() / pmt.getValue() ;
}
return this.value = new cNumber( res );
......
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