Ignore:
Timestamp:
Mar 31, 2010, 1:47:45 PM (14 years ago)
Author:
roby
Message:

funzione per gestione calcolo percentuali: applicata a intera griglia

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/modules/Elezioni/funzioni.php

    r65 r66  
    422422                                                $temp2tot+=$valperc;
    423423                                        }
     424                                        if($temp2tot>100)
    424425                                        while ($temp2tot>100){
    425426                                                    foreach ($temp2 as $key => $val) {
    426                                                 if ($val == max($temp2)) {$temp3[$key]-=0.01;$temp2tot-=0.01;$temp2[$key]=0;break;}
     427                                                if ($val == max($temp2)) {$temp3[$key]-=0.01;$temp2tot-=0.01;$temp2[$key]=0; break;}
    427428                                                }
    428429                                        }
    429                                         while ($temp2tot<100){
     430                                        if("$temp2tot"=="100") return($temp3);
     431                                        while ($temp2tot<100.00){
    430432                                                    foreach ($temp2 as $key => $val) {
    431433                                                if ($val == min($temp2)) {$temp3[$key]+=0.01;$temp2tot+=0.01;$temp2[$key]=1;break;}
Note: See TracChangeset for help on using the changeset viewer.