This is a function i used in javascript and in react application where i have a questionair, quiz, test or examp app to get the final score of the correct answer and the wrong answer.

very simple calculation:

    function percentage(correct, wrong) {
        console.log(`LINE 380 correct=`, correct);
        console.log(`LINE 380 wrong=`, wrong);
        let totalValue =  wrong + correct;
        return Math.round((correct / totalValue) *100);
    }