Jump to content
php.lv forumi

noapaljot liidz 0.1


autly

Recommended Posts

$tot_votes = dbcount("(rating_item_id)", "ratings", "rating_item_id='".$rating_item_id."' AND rating_type='".$rating_type."'");
$query = "SELECT rating_item_id, SUM(rating_vote) FROM rusfusion_ratings WHERE rating_item_id='".$rating_item_id."' GROUP BY rating_item_id ";  
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$summa = $row['SUM(rating_vote)'];
if($tot_votes == 0) {
} 
else 
{
$avg = $summa / $tot_votes;

 

Kaa var noapalot liiidz 0.1? Gadas ka vins izdod 4.66666667, bet vajadzeetu lai 4.6. Noteikti ir kkada komandu, par kuras eksistenci vnk nezinu ;)

Link to comment
Share on other sites

Kā tad to sauc?

Man mācīja, ka to tāpat vien sauc - par apaļošanu. Apaļot var uz leju, uz augšu, līdz tuvākajam veselajam skaitlim, uz 0 pusi, uz +/- bezgalības pusi. Variantu daudz. Tāda defaultā varianta nemaz nav.

Link to comment
Share on other sites

×
×
  • Create New...