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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52077 954022d7-b5bf-4e40-9824-e11837661b57
parent ee5b1e83
......@@ -9,9 +9,10 @@
<link rel="stylesheet" href="qunit/qunit-1.11.0.css" type="text/css" media="screen" />
<script type="text/javascript" src="qunit/qunit-1.11.0.js"></script>
<script type="text/javascript" src="../../../Common/3rdparty/XRegExp/xregexp-all.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/XRegExp/xregexp-all.js"></script>
<script src="../../Common/downloaderfiles.js"></script>
<script type="text/javascript" src="../../Common/browser.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/Underscore/underscore-min.js"></script>
<script type="text/javascript" src="../../Common/3rdparty/Sockjs/sockjs-0.3.min.js"></script>
<script type="text/javascript" src="../../Common/docscoapicommon.js"></script>
......@@ -24,10 +25,9 @@
<script type="text/javascript" src="../../Common/FontsFreeType/font_engine.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/FontFile.js"></script>
<script type="text/javascript" src="../../Common/FontsFreeType/FontManager.js"></script>
<script type="text/javascript" src="../../Word/Drawing/AllFonts.js"></script>
<script type="text/javascript" src="../../Word/Drawing/Externals.js"></script>
<script type="text/javascript" src="../../Word/Drawing/Metafile.js"></script>
<script type="text/javascript" src="../../Word/Drawing/AllFonts.js"></script>
<script type="text/javascript" src="../utils/utils.js"></script>
<script type="text/javascript" src="../model/clipboard.js"></script>
......@@ -75,9 +75,6 @@
<script type="text/javascript" src="../apiDefines.js"></script>
<script type="text/javascript" src="../api.js"></script>
<!--for presentation-->
<script type="text/javascript" src="../../Common/PresentationSerializeAdapter.js"></script>
<!--for theme-->
<script type="text/javascript" src="../../Common/Shapes/EditorSettings.js"></script>
<script type="text/javascript" src="../../Common/Shapes/Serialize.js"></script>
......@@ -95,31 +92,12 @@
<!--for chart-->
<script type="text/javascript" src="../../Common/SerializeCommonWordExcel.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.core.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.annotate.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.context.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.effects.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.key.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.resizing.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.tooltips.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.common.zoom.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.bar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.bipolar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.gantt.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.hbar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.line.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.pie.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.radar.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.rose.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.rscatter.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.scatter.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.waterfall.js"></script>
<script src="../../Common/Charts/libraries/OfficeExcel.chartProperties.js"></script>
<!--for colors-->
......
......@@ -498,7 +498,7 @@
strictEqual( oParser.calculate().getValue(), "1234567.5556" );
oParser = new parserFormula( "FIXED(1234567)", "A1", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "1,234,567" );
strictEqual( oParser.calculate().getValue(), "1,234,567.00" );
} )
test( "Test: \"REPLACE\"", function () {
......@@ -597,7 +597,7 @@
oParser = new parserFormula( "VALUE(\"$1,000\")", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), "#VALUE!" );
strictEqual( oParser.calculate().getValue(), 1000 );
oParser = new parserFormula( "VALUE(\"23-Mar-2002\")", "A2", ws );
ok( oParser.parse() );
......@@ -948,6 +948,46 @@
} )
test( "Test: \"NPER\"", function () {
function nper(rate,pmt,pv,fv,type){
if ( rate === undefined || rate === null )
rate = 0;
if ( pmt === undefined || pmt === null )
pmt = 0;
if ( pv === undefined || pv === null )
pv = 0;
if ( type === undefined || type === null )
type = 0;
if ( fv === undefined || fv === null )
fv = 0;
var res;
if ( rate != 0 ) {
res = (-fv * rate + pmt * (1 + rate * type)) / (rate * pv + pmt * (1 + rate * type))
res = Math.log( res ) / Math.log( 1+rate )
}
else {
res = (- pv - fv )/ pmt ;
}
return res;
}
oParser = new parserFormula( "NPER(0.12/12,-100,-1000,10000,1)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), nper(0.12/12,-100,-1000,10000,1) );
oParser = new parserFormula( "NPER(0.12/12,-100,-1000)", "A2", ws );
ok( oParser.parse() );
strictEqual( oParser.calculate().getValue(), nper(0.12/12,-100,-1000) );
} )
test( "Test: \"TIMEVALUE\"", function () {
oParser = new parserFormula( "timevalue(\"10:02:34\")", "A2", ws );
ok( oParser.parse() );
......
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