function roundOff(value, precision) { value = "" + value //convert value to string precision = parseInt(precision);
var whole = "" + Math.round(value * Math.pow(10, precision));
var decPoint = whole.length - precision;
if(decPoint != 0) { result = whole.substring(0, decPoint); result += "."; result += whole.substring(decPoint, whole.length); } else { result = 0; result += "."; result += whole.substring(decPoint, whole.length); } return result; }
function Calcular(){
vTotal = 0
vTotal = vTotal + Formulario.Recamara_01.value * 1.15 vTotal = vTotal + Formulario.Recamara_02.value * 1.15 vTotal = vTotal + Formulario.Recamara_03.value * 0.85 vTotal = vTotal + Formulario.Recamara_04.value * 1.70 vTotal = vTotal + Formulario.Recamara_05.value * 1.70 vTotal = vTotal + Formulario.Recamara_06.value * 0.85 vTotal = vTotal + Formulario.Recamara_07.value * 2.00 vTotal = vTotal + Formulario.Recamara_08.value * 2.00 vTotal = vTotal + Formulario.Recamara_09.value * 1.00 vTotal = vTotal + Formulario.Recamara_10.value * 2.50 vTotal = vTotal + Formulario.Recamara_11.value * 2.50 vTotal = vTotal + Formulario.Recamara_12.value * 1.27 vTotal = vTotal + Formulario.Recamara_13.value * 1.27 vTotal = vTotal + Formulario.Recamara_14.value * 0.15 vTotal = vTotal + Formulario.Recamara_15.value * 1.40
vTotal = vTotal + Formulario.Cuarto_01.value * 0.45 vTotal = vTotal + Formulario.Cuarto_02.value * 0.28 vTotal = vTotal + Formulario.Cuarto_03.value * 0.57 vTotal = vTotal + Formulario.Cuarto_04.value * 0.06 vTotal = vTotal + Formulario.Cuarto_05.value * 0.06 vTotal = vTotal + Formulario.Cuarto_06.value * 0.06 vTotal = vTotal + Formulario.Cuarto_07.value * 0.85 vTotal = vTotal + Formulario.Cuarto_08.value * 0.17 vTotal = vTotal + Formulario.Cuarto_09.value * 0.09
vTotal = vTotal + Formulario.Sala_01.value * 0.42 vTotal = vTotal + Formulario.Sala_02.value * 0.60 vTotal = vTotal + Formulario.Sala_03.value * 0.09 vTotal = vTotal + Formulario.Sala_04.value * 0.57 vTotal = vTotal + Formulario.Sala_05.value * 0.12 vTotal = vTotal + Formulario.Sala_06.value * 0.60 vTotal = vTotal + Formulario.Sala_07.value * 0.45 vTotal = vTotal + Formulario.Sala_08.value * 0.42 vTotal = vTotal + Formulario.Sala_09.value * 0.75 vTotal = vTotal + Formulario.Sala_10.value * 1.42 vTotal = vTotal + Formulario.Sala_11.value * 1.42 vTotal = vTotal + Formulario.Sala_12.value * 1.00 vTotal = vTotal + Formulario.Sala_13.value * 0.36 vTotal = vTotal + Formulario.Sala_14.value * 0.85 vTotal = vTotal + Formulario.Sala_15.value * 1.15
vTotal = vTotal + Formulario.Aplicaciones_01.value * 0.28 vTotal = vTotal + Formulario.Aplicaciones_02.value * 0.28 vTotal = vTotal + Formulario.Aplicaciones_03.value * 0.28 vTotal = vTotal + Formulario.Aplicaciones_04.value * 1.85 vTotal = vTotal + Formulario.Aplicaciones_05.value * 1.27 vTotal = vTotal + Formulario.Aplicaciones_06.value * 0.85 vTotal = vTotal + Formulario.Aplicaciones_07.value * 0.60 vTotal = vTotal + Formulario.Aplicaciones_08.value * 0.71 vTotal = vTotal + Formulario.Aplicaciones_09.value * 0.71 vTotal = vTotal + Formulario.Aplicaciones_10.value * 0.28 vTotal = vTotal + Formulario.Aplicaciones_11.value * 0.09 vTotal = vTotal + Formulario.Aplicaciones_12.value * 0.09
vTotal = vTotal + Formulario.ninos_01.value * 0.56 vTotal = vTotal + Formulario.ninos_02.value * 0.22 vTotal = vTotal + Formulario.ninos_03.value * 0.60 vTotal = vTotal + Formulario.ninos_04.value * 0.50 vTotal = vTotal + Formulario.ninos_05.value * 0.35 vTotal = vTotal + Formulario.ninos_06.value * 0.085 vTotal = vTotal + Formulario.ninos_07.value * 0.15 vTotal = vTotal + Formulario.ninos_08.value * 0.15 vTotal = vTotal + Formulario.ninos_09.value * 0.30
vTotal = vTotal + Formulario.Comedor_01.value * 0.85 vTotal = vTotal + Formulario.Comedor_02.value * 0.57 vTotal = vTotal + Formulario.Comedor_03.value * 0.57 vTotal = vTotal + Formulario.Comedor_04.value * 1.00 vTotal = vTotal + Formulario.Comedor_05.value * 0.30 vTotal = vTotal + Formulario.Comedor_06.value * 0.15
vTotal = vTotal + Formulario.Deportes_01.value * 1.70 vTotal = vTotal + Formulario.Deportes_02.value * 1.70 vTotal = vTotal + Formulario.Deportes_03.value * 2.30 vTotal = vTotal + Formulario.Deportes_04.value * 0.28 vTotal = vTotal + Formulario.Deportes_05.value * 0.09 vTotal = vTotal + Formulario.Deportes_06.value * 0.09
vTotal = vTotal + Formulario.Otros_01.value * 1.00 vTotal = vTotal + Formulario.Otros_02.value * 1.15 vTotal = vTotal + Formulario.Otros_03.value * 0.15 vTotal = vTotal + Formulario.Otros_04.value * 0.30 vTotal = vTotal + Formulario.Otros_05.value * 0.60 vTotal = vTotal + Formulario.Otros_06.value * 0.43 vTotal = vTotal + Formulario.Otros_07.value * 0.042 vTotal = vTotal + Formulario.Otros_08.value * 0.084 vTotal = vTotal + Formulario.Otros_09.value * 0.126 vTotal = vTotal + Formulario.Otros_10.value * 0.17 vTotal = vTotal + Formulario.Otros_11.value * 0.20 vTotal = vTotal + Formulario.Otros_12.value * 0.09
if (vTotal == 0) { Total.style.marginLeft = 10 Total.style.fontFamily = "Tahoma" Total.style.fontSize = "10pt" Total.style.fontWeight = 700
Total.innerText = "0 m3"
Total2.style.marginLeft = 10 Total2.style.fontFamily = "Tahoma" Total2.style.fontSize = "10pt" Total2.style.fontWeight = 700
Total2.innerText = "0 m2"
} else { Total.style.marginLeft = 10 Total.style.fontFamily = "Tahoma" Total.style.fontSize = "10pt" Total.style.fontWeight = 700
Total.innerText = roundOff(vTotal,2) + " m3"
Total2.style.marginLeft = 10 Total2.style.fontFamily = "Tahoma" Total2.style.fontSize = "10pt" Total2.style.fontWeight = 700
Total2.innerText = roundOff(vTotal/2.4,2) + " m2"
} }