Commit 789b75eb authored by GoshaZotov's avatar GoshaZotov

add UNICODE formula

parent c29c2e79
......@@ -57,9 +57,10 @@
var cFormulaFunctionGroup = AscCommonExcel.cFormulaFunctionGroup;
cFormulaFunctionGroup['TextAndData'] = cFormulaFunctionGroup['TextAndData'] || [];
cFormulaFunctionGroup['TextAndData'].push(cASC, cBAHTTEXT, cCHAR, cCLEAN, cCODE, cCONCATENATE, cCONCAT, cDOLLAR, cEXACT,
cFIND, cFINDB, cFIXED, cJIS, cLEFT, cLEFTB, cLEN, cLENB, cLOWER, cMID, cMIDB, cNUMBERVALUE, cPHONETIC, cPROPER, cREPLACE,
cREPLACEB, cREPT, cRIGHT, cRIGHTB, cSEARCH, cSEARCHB, cSUBSTITUTE, cT, cTEXT, cTEXTJOIN, cTRIM, cUPPER, cVALUE);
cFormulaFunctionGroup['TextAndData'].push(cASC, cBAHTTEXT, cCHAR, cCLEAN, cCODE, cCONCATENATE, cCONCAT, cDOLLAR,
cEXACT, cFIND, cFINDB, cFIXED, cJIS, cLEFT, cLEFTB, cLEN, cLENB, cLOWER, cMID, cMIDB, cNUMBERVALUE, cPHONETIC,
cPROPER, cREPLACE, cREPLACEB, cREPT, cRIGHT, cRIGHTB, cSEARCH, cSEARCHB, cSUBSTITUTE, cT, cTEXT, cTEXTJOIN,
cTRIM, cUNICODE, cUPPER, cVALUE);
cFormulaFunctionGroup['NotRealised'] = cFormulaFunctionGroup['NotRealised'] || [];
cFormulaFunctionGroup['NotRealised'].push(cASC, cBAHTTEXT, cJIS, cPHONETIC);
......@@ -1912,6 +1913,41 @@
}).replace(/^\s|\s$/g, ""))
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
*/
function cUNICODE() {
this.name = "UNICODE";
this.value = null;
this.argumentsCurrent = 0;
}
cUNICODE.prototype = Object.create(cBaseFunction.prototype);
cUNICODE.prototype.constructor = cUNICODE;
cUNICODE.prototype.argumentsMin = 1;
cUNICODE.prototype.argumentsMax = 1;
cUNICODE.prototype.isXLFN = true;
cUNICODE.prototype.Calculate = function (arg) {
var oArguments = this._prepareArguments(arg, arguments[1]);
var argClone = oArguments.args;
var arg0 = argClone[0].tocString();
var argError;
if (argError = this._checkErrorArg(argClone)) {
return this.value = argError;
}
function _func(argArray) {
var str = argArray[0].toString();
var res = str.charCodeAt(0);
return new cNumber(res);
}
return this.value = this._findArrayInNumberArguments(oArguments, _func, true);
};
/**
* @constructor
* @extends {AscCommonExcel.cBaseFunction}
......
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