Fixed rounding issue caused by JavaScript and the conversion to String.
This commit is contained in:
@ -707,8 +707,7 @@ $(function() {
|
|||||||
var score = $('#score').data('score');
|
var score = $('#score').data('score');
|
||||||
var maxium_score = $('#score').data('maximum-score');
|
var maxium_score = $('#score').data('maximum-score');
|
||||||
if (score >= 0 && score <= maxium_score && maxium_score >0 ) {
|
if (score >= 0 && score <= maxium_score && maxium_score >0 ) {
|
||||||
var rounded_number = (score / maxium_score ).toFixed(2);
|
var percentage_score = (score / maxium_score * 100 ).toFixed(2);
|
||||||
var percentage_score = rounded_number * 100
|
|
||||||
$('.score').html(percentage_score + '%');
|
$('.score').html(percentage_score + '%');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user