Commit 7d1b98b9 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fixed: Bug 24664 - Аргумент Npery при вычислении в формуле NOMINAL не обрезается до целого

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56566 954022d7-b5bf-4e40-9824-e11837661b57
parent c9f3d056
......@@ -3221,12 +3221,14 @@ cNOMINAL.prototype.Calculate = function ( arg ) {
if ( effectRate instanceof cError ) return this.value = effectRate;
if ( npery instanceof cError ) return this.value = npery;
var eR = effectRate.getValue(),
np = npery.getValue();
effectRate = effectRate.getValue();
npery = npery.getValue();
if ( eR <= 0 || npery < 1 )
npery = Math.floor( npery );
if ( effectRate <= 0 || npery < 1 )
return this.value = new cError( cErrorType.not_numeric );
this.value = new cNumber( ( Math.pow( eR + 1, 1 / np ) - 1 ) * np );
this.value = new cNumber( ( Math.pow( effectRate + 1, 1 / npery ) - 1 ) * npery );
// this.value.numFormat = 9;
return this.value;
......
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