Commit 71c54fc7 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56504 954022d7-b5bf-4e40-9824-e11837661b57
parent ac29412e
...@@ -2369,12 +2369,14 @@ cEFFECT.prototype.Calculate = function ( arg ) { ...@@ -2369,12 +2369,14 @@ cEFFECT.prototype.Calculate = function ( arg ) {
if ( nominalRate instanceof cError ) return this.value = nominalRate; if ( nominalRate instanceof cError ) return this.value = nominalRate;
if ( npery instanceof cError ) return this.value = npery; if ( npery instanceof cError ) return this.value = npery;
var nr = nominalRate.getValue(), np = npery.getValue(); nominalRate = nominalRate.getValue();
if ( nominalRate.getValue() <= 0 || npery.getValue() < 1 ) { npery = Math.floor( npery.getValue() );
if ( nominalRate <= 0 || npery < 1 ) {
return this.value = new cError( cErrorType.not_numeric ); return this.value = new cError( cErrorType.not_numeric );
} }
return this.value = new cNumber( Math.pow( (1 + nr / np), np ) - 1 ); return this.value = new cNumber( Math.pow( (1 + nominalRate / npery), npery ) - 1 );
}; };
cEFFECT.prototype.getInfo = function () { cEFFECT.prototype.getInfo = function () {
return { return {
......
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