Commit 569a4918 authored by GoshaZotov's avatar GoshaZotov

add ECMA.CEILING formula

parent 795c4ae3
......@@ -913,6 +913,54 @@ $( function () {
strictEqual( oParser.calculate().getValue(), -4, 'ISO.CEILING(-4.3,-2)' );
} );
test( "Test: \"CEILING\"", function () {
oParser = new parserFormula( 'CEILING(2.5, 1)', "A1", ws );
ok( oParser.parse(), 'CEILING(2.5, 1)' );
strictEqual( oParser.calculate().getValue(), 3, 'CEILING(2.5, 1)' );
oParser = new parserFormula( 'CEILING(-2.5, -2)', "A1", ws );
ok( oParser.parse(), 'CEILING(-2.5, -2)' );
strictEqual( oParser.calculate().getValue(), -4, 'CEILING(-2.5, -2)' );
oParser = new parserFormula( 'CEILING(-2.5, 2)', "A1", ws );
ok( oParser.parse(), 'CEILING(-2.5, 2)' );
strictEqual( oParser.calculate().getValue(), -2, 'CEILING(-2.5, 2)' );
oParser = new parserFormula( 'CEILING(1.5, 0.1)', "A1", ws );
ok( oParser.parse(), 'CEILING(1.5, 0.1)' );
strictEqual( oParser.calculate().getValue(), 1.5, 'CEILING(1.5, 0.1)' );
oParser = new parserFormula( 'CEILING(0.234, 0.01)', "A1", ws );
ok( oParser.parse(), 'CEILING(0.234, 0.01)' );
strictEqual( oParser.calculate().getValue(), 0.24, 'CEILING(0.234, 0.01)' );
} );
test( "Test: \"ECMA.CEILING\"", function () {
oParser = new parserFormula( 'ECMA.CEILING(2.5, 1)', "A1", ws );
ok( oParser.parse(), 'ECMA.CEILING(2.5, 1)' );
strictEqual( oParser.calculate().getValue(), 3, 'ECMA.CEILING(2.5, 1)' );
oParser = new parserFormula( 'ECMA.CEILING(-2.5, -2)', "A1", ws );
ok( oParser.parse(), 'ECMA.CEILING(-2.5, -2)' );
strictEqual( oParser.calculate().getValue(), -4, 'ECMA.CEILING(-2.5, -2)' );
oParser = new parserFormula( 'ECMA.CEILING(-2.5, 2)', "A1", ws );
ok( oParser.parse(), 'ECMA.CEILING(-2.5, 2)' );
strictEqual( oParser.calculate().getValue(), -2, 'ECMA.CEILING(-2.5, 2)' );
oParser = new parserFormula( 'ECMA.CEILING(1.5, 0.1)', "A1", ws );
ok( oParser.parse(), 'ECMA.CEILING(1.5, 0.1)' );
strictEqual( oParser.calculate().getValue(), 1.5, 'ECMA.CEILING(1.5, 0.1)' );
oParser = new parserFormula( 'ECMA.CEILING(0.234, 0.01)', "A1", ws );
ok( oParser.parse(), 'ECMA.CEILING(0.234, 0.01)' );
strictEqual( oParser.calculate().getValue(), 0.24, 'ECMA.CEILING(0.234, 0.01)' );
} );
test( "Test: \"COMBINA\"", function () {
oParser = new parserFormula( 'COMBINA(4,3)', "A1", ws );
ok( oParser.parse(), 'COMBINA(4,3)' );
......
......@@ -84,9 +84,6 @@
cROUNDUP, cSEC, cSECH, cSERIESSUM, cSIGN, cSIN, cSINH, cSQRT, cSQRTPI, cSUBTOTAL, cSUM, cSUMIF, cSUMIFS,
cSUMPRODUCT, cSUMSQ, cSUMX2MY2, cSUMX2PY2, cSUMXMY2, cTAN, cTANH, cTRUNC);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cECMA_CEILING);
var cSubTotalFunctionType = {
includes: {
AVERAGE: 1, COUNT: 2, COUNTA: 3, MAX: 4, MIN: 5, PRODUCT: 6, STDEV: 7, STDEVP: 8, SUM: 9, VAR: 10, VARP: 11
......@@ -1524,13 +1521,15 @@
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
* @extends {cCEILING}
*/
//TODO нигде нет отписания к этой функции! работает так же как и cCEILING на всех примерах.
function cECMA_CEILING() {
cBaseFunction.call(this, "ECMA_CEILING");
cCEILING.call(this);
this.name = "ECMA.CEILING";
}
cECMA_CEILING.prototype = Object.create(cBaseFunction.prototype);
cECMA_CEILING.prototype = Object.create(cCEILING.prototype);
cECMA_CEILING.prototype.constructor = cECMA_CEILING;
/**
......
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