diff --git a/html/inc/credit.inc b/html/inc/credit.inc
index e4ab635191..6b33c51fc8 100644
--- a/html/inc/credit.inc
+++ b/html/inc/credit.inc
@@ -17,7 +17,7 @@ function update_average($now, $work_start_time, $work, &$avg, &$avg_time) {
$avg += (1.0-$weight)*($work/$diff_days);
}
else {
- $avg += M_LN2*work*86400/CREDIT_HALF_LIFE;
+ $avg += M_LN2*$work*86400/CREDIT_HALF_LIFE;
}
} else if ($work) {
$dd = ($now - $work_start_time)/86400;