round result to fixed 0 digits in percentage output

This commit is contained in:
yqbk
2016-06-15 12:03:34 +02:00
parent d5b78c29da
commit 894f8abda2

View File

@@ -707,7 +707,7 @@ $(function() {
var score = $('#score').data('score');
var maxium_score = $('#score').data('maximum-score');
if (score >= 0 && score <= maxium_score && maxium_score >0 ) {
var percentage_score = (score / maxium_score * 100 ).toFixed(2);
var percentage_score = (score / maxium_score * 100 ).toFixed(0);
$('.score').html(percentage_score + '%');
}
else {