Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/08/2010, 07:27
humbertoqa
 
Fecha de Ingreso: septiembre-2006
Mensajes: 2
Antigüedad: 18 años, 4 meses
Puntos: 0
Cómo agregar Puntos Decimales?

Realicé una caculadora para calcular el costo de una la póliza de seguro. Pero cómo hago para que cuando se ingresen los números, se coloquen automaticamente los puntos decimales.

Qué debo hacer?

Muchas Gracias!

Aquí está el Código:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Calculadora Seguro</title>
<script>
function calcular() {
ne=eval(document.getElementById('neto').value);
iv=eval(document.getElementById('iva').value);
tiv = ne + iv; /*Casilla Total IVA*/
tot = tiv / 2; /*Casilla Total */
document.getElementById('totiva').value=tiv;
document.getElementById('total').value=tot;
}
</script>
</head>
<body>
<li> Valor Canon Arriendo <input type="text" id="neto" value="" onkeyup="calcular()" onKeyPress="EvaluateText('%f', this);" onBlur="this.value = NumberFormat(this.value, '1', '.', ',')" /> </li><br />
<li> Valor Administracion <input type="text" id="iva" value="" onkeyup="calcular()" onKeyPress="EvaluateText('%f', this);" onBlur="this.value = NumberFormat(this.value, '1', '.', ',')" /> </li><br />
<li> Total....... <input type="text" id="totiva" disabled="disabled" /> </li><br />
<li> Valor Poliza...... <input type="text" id="total" disabled="disabled" /> </li><br />
</body>
</html>