Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/10/2004, 06:36
angsanchez
 
Fecha de Ingreso: octubre-2004
Ubicación: España
Mensajes: 894
Antigüedad: 19 años, 6 meses
Puntos: 3
Código HTML:
<head>
<script type="text/javascript">
function redondeaAlAlza(x,r) {
    xx = Math.floor(x/r)
    if (xx!=x/r) {xx++}
    return (xx*r)
}
</script>
</head>

<body>
<form>
<input type="text" name="entrada">
<input type="button" value="Redondear" onClick="alert(redondeaAlAlza(this.form.entrada.value,1000))">
</form>
</body>