Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/04/2010, 14:37
Alexis08
 
Fecha de Ingreso: abril-2010
Mensajes: 6
Antigüedad: 14 años
Puntos: 0
Respuesta: Cifras con coma

Gracias amigo por la ayuda pero no me funciono

Aqui te dejo el SCRIPT para ver que se puede hacer

<SCRIPT>

function dp(price)
{
string = "" + price;
number = string.length - string.indexOf('.');
if (string.indexOf('.') == -1)
return string + '.00';
if (number == 1)
return string + '00';
if (number == 2)
return string + '0';
if (number > 3)
return string.substring(0,string.length-number+3);
return string;
}

function calculate()
{
document.calcform.total1.value = dp((document.calcform.price1.value)*(document.calc form.quantity1.value))
document.calcform.total2.value = dp((document.calcform.price2.value)*(document.calc form.quantity2.value))
document.calcform.total3.value = dp((document.calcform.price3.value)*(document.calc form.quantity3.value))
document.calcform.total4.value = dp((document.calcform.price4.value)*(document.calc form.quantity4.value))
document.calcform.total5.value = dp((document.calcform.price5.value)*(document.calc form.quantity5.value))
document.calcform.total6.value = dp((document.calcform.price6.value)*(document.calc form.quantity6.value))
document.calcform.total7.value = dp((document.calcform.price7.value)*(document.calc form.quantity7.value))
document.calcform.total8.value = dp((document.calcform.price8.value)*(document.calc form.quantity8.value))
document.calcform.total9.value = dp((document.calcform.price9.value)*(document.calc form.quantity9.value))
document.calcform.total10.value = dp((document.calcform.price10.value)*(document.cal cform.quantity10.value))

document.calcform.subtotal.value = dp(eval(document.calcform.total1.value) + eval(document.calcform.total2.value) + eval(document.calcform.total3.value) + eval(document.calcform.total4.value) + eval(document.calcform.total5.value) + eval(document.calcform.total6.value) + eval(document.calcform.total7.value) + eval(document.calcform.total8.value) + eval(document.calcform.total9.value) + eval(document.calcform.total10.value))

document.calcform.tax.value = dp((document.calcform.subtotal.value)*0.175)
document.calcform.total.value = dp((document.calcform.subtotal.value)*1.175)
}

</SCRIPT>