嗨,我对计算百分比有点困惑。我想知道我将如何计算百分比以找到答案百分比。
我有数组值:
$week1_1 = 93.0;
$week1_2 = 0.0;
$week2_1 = 100.0;
$week2_2 = 0.0;
$week3_1 = 100.0;
$week3_2 = 0.0;
$week4_1 = 100.0;
$week4_2 = 0.0;
$arr_week_ave = array();
$arr_week_ave[] = $week1_1;
$arr_week_ave[] = $week1_2;
$arr_week_ave[] = $week2_1;
$arr_week_ave[] = $week2_2;
$arr_week_ave[] = $week3_1;
$arr_week_ave[] = $week3_2;
$arr_week_ave[] = $week4_1;
$arr_week_ave[] = $week4_2;
$ave = ROUND(((array_sum($arr_values) / count($arr_week_ave)) * 100), 2);
echo $ave;
然后我将它分成 4 倍到 100.. 但答案是 4715 。答案是错误的,我希望它是 98.7..
有人可以帮忙处理这个案子吗?