-1
私は最大2小数点以下のパーセントを取得したいと思います。この合計スコアのようなIM得る出力26.666666666666668%JavaScriptで2小数点以下の割合を取得するには
所望の出力26.66パーセントである
if(pos >= questions.length){
test.innerHTML = "<h2>You gave "+correct+" CORRECT answers out of "+questions.length+" questions </h2><br/><h3>Total Score is "+correct/questions.length * 100 +" %</h3>";
_("test_status").innerHTML = "Quiz 1 Completed";
pos = 0;
correct = 0;
return false;
}
'(正しい/ questions.length * 100).toFixed(2)' – Satpal