+ Start a Discussion
sreekanth vallepusreekanth vallepu 

how to calculate percentage it will show the error

totalmarks(){
        const t=parseInt(this.telugu);
        const h=parseInt(this.hindi);
        const e=parseInt(this.english);
        const m=parseInt(this.maths);
        const s=parseInt(this.science);
        const so=parseInt(this.social);
        this.currentoutput='totalpercentage=' +(t+h+e+m+s+so/600);
    }
CharuDuttCharuDutt
Hii Sreekanth vallepu
Try The Below Code
totalmarks(){
        const t=Number(this.telugu);
        const h=Number(this.hindi);
        const e=Number(this.english);
        const m=Number(this.maths);
        const s=Number(this.science);
        const so=Number(this.social);
        this.currentoutput='totalpercentage=' + Math.floor(Number((t+h+e+m+s+so)/600*100));
    }
Please Mark it As Best Answer If It Helps
Thank You!