Hola, ayabass
La función es complicada. Por ahora, la parte de pesetas, que se puede hacer así:
Código:
function parse2Pesetas(f) {
i=f.intro.value.indexOf(",");
if(i>0) {
s=f.intro.value;
f.intro.value=f.intro.value.substring(0,i)+"."+s.substring(i+1,f.intro.value.length);
}
if(!isNaN(parseFloat(f.intro.value))) {
redondeo=parseFloat(f.intro.value)*euroValue;
ajuste=Math.round(redondeo);
// ajuste es número entero, no es necesario cuidarse de los decimales
ajuste=ajuste.toString();
var k=ajuste.length
var ajuste2=''
if (k>9) { ajuste2+=ajuste.substring(0,k-9)+'.' }
if (k>6) { ajuste2+=ajuste.substring(k-9,k-6)+'.' }
if (k>3) { ajuste2+=ajuste.substring(k-6,k-3)+'.' }
ajuste2+=ajuste.substr(k-3)
f.resultado.value=ajuste2+" Pts";
}
}
Seguro que hay una forma más elegante de hacerlo, pero así funciona.