Skip to content

Commit

Permalink
Issue #SB-7779 merge: Merge pull request #57 from project-sunbird/ui-fix
Browse files Browse the repository at this point in the history
Issue #SB-7779 fix: rounding issue fix
  • Loading branch information
pallakartheekreddy authored Oct 9, 2018
2 parents 17733ff + 488e1f3 commit 089a552
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ endPage.controller("endPageController", function($scope, $rootScope, $state,$ele
maxScore = maxScore + 0;
}
});
$scope.score = (totalScore + "/" + maxScore);
$scope.score = ($scope.convert(totalScore) + "/" + $scope.convert(maxScore));
} else {
$scope.score = undefined;
}
Expand Down Expand Up @@ -189,4 +189,11 @@ endPage.controller("endPageController", function($scope, $rootScope, $state,$ele
org.ekstep.service.content.clearTelemetryEvents();
$scope.safeApply();
});

$scope.convert = function(num) {
num = num.toString(); //If it's not already a String
num = num.slice(0, (num.indexOf(".")) + 3); //With 3 exposing the hundredths place
return Number(num); //If you need it back as a Number
};

});

0 comments on commit 089a552

Please sign in to comment.