I have a form, and i want with javascript round a number with 2
decimals to de uper next 0 or five.
IE if you have the number 4,53 it must be rounded to 4,55. Until now i
wrote that
var valor
function redondeo(valor) {
valor= valor *100;
if (valor/5!=Math.floor(v alor/5)){
valor=valor+1;
}
if (valor/5!=Math.floor(v alor/5)){
valor=valor+1;
}
if (valor/5!=Math.floor(v alor/5)){
valor=valor+1;
}
if (valor/5!=Math.floor(v alor/5)){
valor=valor+1;
}
if (valor/5!=Math.floor(v alor/5)){
valor=valor+1;
}
valor=valor/100;
}
But when i call to de function it wrote me in the text box "nan" (not
a number i supose)
document.f1.t1. value=redondeo( (document.f1.pv p1.value)*(docu ment.f1.u1.valu e));
any help would be welcome, sorry for my poor english and greetings
from spain