Commit 5ea9d97e authored by GoshaZotov's avatar GoshaZotov

add function for DGET formula

parent 17bb9aab
......@@ -338,6 +338,31 @@
cDGET.prototype = Object.create(cBaseFunction.prototype);
cDGET.prototype.constructor = cDGET;
cDGET.prototype.argumentsMin = 3;
cDGET.prototype.argumentsMax = 3;
cDGET.prototype.Calculate = function (arg) {
var oArguments = this._prepareArguments(arg, arguments[1], true, [cElementType.array, null, cElementType.array]);
var argClone = oArguments.args;
argClone[1] = argClone[1].tocString();
var argError;
if (argError = this._checkErrorArg(argClone)) {
return this.value = argError;
}
var resArr = getNeedValuesFromDataBase(argClone[0], argClone[1], argClone[2]);
if(cElementType.error === resArr.type){
return resArr;
}
if(1 !== resArr.length){
return this.value = new cError(cErrorType.not_numeric);
}
var res = new cNumber(resArr[0]);
return this.value = cElementType.error === res.type ? new cNumber(0) : res;
};
/**
* @constructor
......
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