Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/06/2005, 03:31
angsanchez
 
Fecha de Ingreso: octubre-2004
Ubicación: España
Mensajes: 894
Antigüedad: 22 años
Puntos: 3
Hola, mauricio2004
Prueba con ésta:
Código PHP:
function decimales(Numero, Decimales) {
    
pot = Math.pow(10,Decimales);
    
num = Math.round(Numero * pot) / pot;
    
nume = num.toString().split('.');
    
entero = nume[0];
    
decima = nume[1];
    if (
decima != undefined) {
        
fin = Decimales-decima.length; }
    else {
        
decima = '';
        
fin = Decimales; }
    for(
i=0;i<fin;i++)
      
decima+=String.fromCharCode(48); 
    
num=entero+'.'+decima;
    return 
num;
} 
__________________
Angel :cool: