Hey
I'm using the mysql avg() function in my select statement. I display the avg but I don't know how to set a max limit to the decimal places I want shown. Here is my code:
$getrating = mysql_query("SELECT avg(rating) as avg from table where submittedbyuser = '$_SESSION[username]'");
$ratingnum = mysql_num_rows($getrating);
$ratings = mysql_fetch_array($getrating);
$avg = $ratings['avg']; // I'm assuming I have to use some sort of trim function or something here
echo $avg;
any ideas? thanks