Hay alguna manera de pasar una formula en javascript a formula de excel?
spoiler
labels[0] = "Rectangular";
labels[1] = "Cube";
labels[2] = "Bowfront";
labels[3] = "Corner Pentagon";
labels[4] = "Corner Prisim";
labels[5] = "L-Shaped";
labels[6] = "Flat Hexagon";
labels[7] = "Hexagonal";
labels[8] = "Octagonal";
labels[9] = "Ragular Polygon Prisim";
labels[10] = "Cylinder";
labels[11] = "Half Cylinder";
spoiler
//Action tag #0
function formatDecimals(num, digits)
{
var __reg2 = "";
if (num < 0)
{
num = Math.abs(num);
__reg2 = "-";
}
if (digits <= 0)
{
return String(Math.round(num));
}
var __reg3 = Math.pow(10, digits);
var __reg4 = String(Math.round(num * __reg3) / __reg3);
return __reg2 + __reg4;
}
var inputs = new Array();
var START = 77;
var INTERVAL = 28;
aquatools.onPress = function ()
{
getURL("http://www.theaquatools.com", "_blank");
}
;
var shapeListner = new Object();
shapeListner.handleEvent = function (o)
{
shape.gotoAndStop(shapeCombo.selectedIndex + 1);
updateRelaventInputs(shapeCombo.selectedIndex);
}
;
var unitsListner = new Object();
unitsListner.handleEvent = function (o)
{
var __reg1 = 0;
while (__reg1 < inputs.length)
{
inputs[__reg1].cm.gotoAndStop(unitsCombo.selectedIndex + 1);
++__reg1;
}
volUnis.gotoAndStop(unitsCombo.selectedIndex + 1);
text_listner.handleEvent(new Object());
}
;
var relaventInputs;
var updateRelaventInputs = function (shape)
{
if ((__reg0 = shape) === 0)
{
relaventInputs = new Array(0, 2, 5);
}
else if (__reg0 === 1)
{
relaventInputs = new Array(1);
relaventInputs[0] = 1;
}
else if (__reg0 === 2)
{
relaventInputs = new Array(0, 1, 2, 5);
}
else if (__reg0 === 3)
{
relaventInputs = new Array(0, 1, 6, 7, 5);
}
else if (__reg0 === 5)
{
relaventInputs = new Array(0, 1, 6, 7, 5);
}
else if (__reg0 === 4)
{
relaventInputs = new Array(0, 1, 5);
}
else if (__reg0 === 6)
{
relaventInputs = new Array(0, 1, 2, 3, 5);
}
else if (__reg0 === 7)
{
relaventInputs = new Array(1, 5);
}
else if (__reg0 === 8)
{
relaventInputs = new Array(1, 5);
}
else if (__reg0 === 9)
{
relaventInputs = new Array(1, 4, 5);
}
else if (__reg0 === 10)
{
relaventInputs = new Array(8, 5);
}
else if (__reg0 === 11)
{
relaventInputs = new Array(8, 5);
}
var __reg1 = 0;
__reg1 = 0;
while (__reg1 < inputs.length)
{
inputs[__reg1]._visible = false;
++__reg1;
}
__reg1 = 0;
while (__reg1 < relaventInputs.length)
{
inputs[relaventInputs[__reg1]]._visible = true;
inputs[relaventInputs[__reg1]].input.text = "";
inputs[relaventInputs[__reg1]]._y = START + __reg1 * INTERVAL;
++__reg1;
}
volumeOut.text = "0";
}
;
var toVolume = function (cubeValue)
{
if (unitsCombo.value == "Metric")
{
return cubeValue / 1000;
}
return cubeValue / 231;
}
;
var calc = function ()
{
var __reg3 = new Number(lengthInput.input.text);
var __reg2 = new Number(sideInput.input.text);
var __reg4 = new Number(widthInput.input.text);
var __reg11 = new Number(frontInput.input.text);
var __reg10 = new Number(nInput.input.text);
var __reg8 = new Number(heightInput.input.text);
var __reg7 = new Number(side2Input.input.text);
var __reg6 = new Number(length2Input.input.text);
var __reg5 = new Number(diameterInput.input.text);
var __reg1 = undefined;
if ((__reg0 = shapeCombo.selectedIndex) === 0)
{
__reg1 = Area.rect(__reg3, __reg4);
}
else if (__reg0 === 1)
{
__reg1 = Area.sqr(__reg2);
__reg8 = __reg2;
}
else if (__reg0 === 2)
{
__reg1 = Area.bowFront(__reg3, __reg2, __reg4);
}
else if (__reg0 === 3)
{
__reg1 = Area.cornerPentagon(__reg3, __reg2, __reg6, __reg7);
}
else if (__reg0 === 4)
{
__reg1 = Area.cornerPrisim(__reg3, __reg2);
}
else if (__reg0 === 5)
{
__reg1 = Area.el(__reg3, __reg2, __reg6, __reg7);
}
else if (__reg0 === 6)
{
__reg1 = Area.flatHexagon(__reg3, __reg2, __reg4, __reg11);
}
else if (__reg0 === 7)
{
__reg1 = Area.Hexagon(__reg2);
}
else if (__reg0 === 8)
{
__reg1 = Area.Octagon(__reg2);
}
else if (__reg0 === 9)
{
__reg1 = Area.regularPolygon(__reg2, __reg10);
}
else if (__reg0 === 10)
{
__reg1 = Area.cylinder(__reg5);
}
else if (__reg0 === 11)
{
__reg1 = Area.halfCylinder(__reg5);
}
var __reg9 = toVolume(__reg1 * __reg8);
volumeOut.text = formatDecimals(__reg9, 1);
}
;
var check_valid = function ()
{
var __reg1 = undefined;
var __reg2 = true;
__reg1 = 0;
while (__reg1 < relaventInputs.length)
{
__reg2 = __reg2 && isFinite(inputs[relaventInputs[__reg1]].input.text);
++__reg1;
}
return __reg2;
}
;
var text_listner = new Object();
text_listner.handleEvent = function (text_fld)
{
if (check_valid())
{
calc();
}
}
;
volumeOut.enabled = false;
inputs[0] = lengthInput;
inputs[1] = sideInput;
inputs[2] = widthInput;
inputs[3] = frontInput;
inputs[4] = nInput;
inputs[5] = heightInput;
inputs[6] = length2Input;
inputs[7] = side2Input;
inputs[8] = diameterInput;
var i = 0;
while (i < inputs.length)
{
inputs[i]._visible = false;
inputs[i].tabIndex = i;
inputs[i].input.addEventListener("change", text_listner);
++i;
}
unitsCombo.addEventListener("change", unitsListner);
shapeCombo.addEventListener("change", shapeListner);
shapeListner.handleEvent(shapeListner);
_global.styles.TextInput.setStyle("backgroundColor", null);
_global.styles.TextArea.borderColor = 6409596;
_global.styles.RectBorder.setStyle("borderStyle", "solid");
_global.styles.RectBorder.setStyle("borderCapColor", 6409596);
_global.styles.RectBorder.setStyle("buttonColor", 6409596);
_global.styles.RectBorder.setStyle("highlightColor", "none");
_global.styles.RectBorder.setStyle("shadowCapColor", "none");
_global.styles.RectBorder.setStyle("shadowColor ", 6409596);
_global.styles.RectBorder.setStyle("themeColor ", 6409596);
_global.styles.RectBorder.setStyle("BorderColor ", 6409596);
Llevo como 4-5 horas mirando por san google y no encuentro manera de pasarlo....