You have a few options for removing the 0s from the end...
1) [man]round()[/man] - This method will round the value up or down to the nearest whole number.
$sql = "SELECT SUM((percent/100)*percenttotal) AS calc FROM Updates WHERE catid='1' GROUP BY catid";
$res = mysql_query($sql) or die("SQL error: ".mysql_error());
if (mysql_num_rows($res)) {
$row = mysql_fetch_assoc($res);
$calc = round($row['calc'], 0);
// do something with the value
}
2) [man]substr()[/man] - This method will chop off the last 3 items of the variable (The .00) and just give you the whole number.
$sql = "SELECT SUM((percent/100)*percenttotal) AS calc FROM Updates WHERE catid='1' GROUP BY catid";
$res = mysql_query($sql) or die("SQL error: ".mysql_error());
if (mysql_num_rows($res)) {
$row = mysql_fetch_assoc($res);
$calc = substr($row['calc'], 0, (strlen($row['calc'])-3));
// do something with the value
}
You can also go with Tsinka's [man]number_format[/man] option. Thomas gave a good explanation and example of that too.