I need to calculate the average daily growth of my company here in storage, but I have doubts, what would be the correct way? Sorry for using Google Translator. =)
Space Used in Storage:
f_date f_used
12/03/2013 2708100
13/03/2013 2708663
14/03/2013 2712155
15/03/2013 2715932
16/03/2013 2717823
17/03/2013 2719575
18/03/2013 2723095
19/03/2013 2726682
20/03/2013 2730365
21/03/2013 2733563
22/03/2013 2737411
23/03/2013 2644001
24/03/2013 2645764
My code in PHP:
for ($i = 1; $i < sizeof($array); $i++) {
$resultado[] = $array[$i] - $array[$i-1];
}
echo array_sum($resultado)/count($resultado);
My result is: -5194.6666666667, is it wrong?