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

fixed: Bug 24746 - Некорректно рассчитывается результат в формуле...

fixed: Bug 24746 - Некорректно рассчитывается результат в формуле PRICE/PRICEDISC с использованием аргумента Basis

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56696 954022d7-b5bf-4e40-9824-e11837661b57
parent 66ea5a24
......@@ -231,10 +231,11 @@ function getcoupncd( settl, matur, frequency ) {
function getprice( settle, mat, rate, yld, redemp, freq, base ) {
var cdays = getcoupdays( new Date( settle ), new Date( mat ), freq, base ),
cdaysnc = getcoupdaysnc( new Date( settle ), new Date( mat ), freq, base ) / cdays,
cnum = getcoupnum( new Date( settle ), (mat), freq ),
cdaybs = getcoupdaybs( new Date( settle ), new Date( mat ), freq, base ),
fT1 = 100 * rate / freq, fT2 = 1 + yld / freq,
cdaysnc = ( cdays - cdaybs ) / cdays,
fT1 = 100 * rate / freq,
fT2 = 1 + yld / freq,
res = redemp / ( Math.pow( 1 + yld / freq, cnum - 1 + cdaysnc ) );
res -= 100 * rate / freq * cdaybs / cdays;
......@@ -4473,7 +4474,7 @@ cPRICEDISC.prototype.Calculate = function ( arg ) {
var settl = Date.prototype.getDateFromExcel( settlement ),
matur = Date.prototype.getDateFromExcel( maturity );
var res = redemption * ( 1 - discount * GetDiffDate( settl, matur, basis ) );
var res = redemption * ( 1 - discount * yearFrac( settl, matur, basis ) );
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