Ver Mensaje Individual
  #10 (permalink)  
Antiguo 08/08/2002, 15:51
chivi
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 889
Antigüedad: 22 años, 4 meses
Puntos: 4
Re: Simple operacion matematica, AYUDA!!!

En efecto, como dice josemi, se hace con number_format($variable,numero_decimales).

Ejemplo:
$variable = 2.683526;
$un_decimal = number_format($variable,1);
echo $un_decimal;

Si lo que queremos es redondearlo:
$variable = 2.683526;
$variable = round($variable);
echo $variable;

Saludos!!

<html><center><embed src="http://www.iespana.es/redmaestro/banner.swf" height=75 width=500>
</embed></center></html>