Hola
PabloP
Veamos si este código te sirve:
Código PHP:
function formateo(num) {
forma='';
num=num.split('.');
entero=num[0];
while (entero.length>0) {
tres=entero.substr(entero.length-3,3);
punto = (forma.length==0) ? '' : '.';
forma = tres + punto + forma;
entero=entero.substr(0,entero.length-3);
}
coma = (num.length==1) ? '' : ','+num[1];
return forma + coma;
}
Saludos,