Skip to content

Commit

Permalink
2 digits accuracy. Refs #27
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Jun 1, 2015
1 parent 46415f3 commit 782b515
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/measure.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function computeAccuracy($watchMeasure){
$userDelta = $watchMeasure->measureUserTime + $watchMeasure->accuracyUserTime;
$refDelta = $watchMeasure->measureReferenceTime + $watchMeasure->accuracyReferenceTime;
$accuracy = ($userDelta*86400/$refDelta)-86400;
$accuracy = floor($accuracy*10.0)/10.0;
$accuracy = sprintf("%.2f", $accuracy);
return $accuracy;
}

Expand Down Expand Up @@ -164,7 +164,7 @@ function addAccuracyMesure($measureId, $referenceTime, $userTime){
if($this->update($measureId, $data) !== false){

$watchMeasure = $this->find($measureId);
$this->computeAccuracy($watchMeasure);
$watchMeasure->accuracy = $this->computeAccuracy($watchMeasure);

return $watchMeasure;
}
Expand Down

0 comments on commit 782b515

Please sign in to comment.