-
Math.round((a/b*100)) But if “0” become “text”
Hi!
We have made this soccer template. It shows the shot accuracy in digits by dividing shots on goal with shots taken.
But if there are 0 shots the text layer saiz “NAN”. We tried to get it to say “No shots taken”. But AE gives this projects contains expression errorsa=parseInt(thisComp.layer("n_ShotsOnGoal").text.sourceText);
b=parseInt(thisComp.layer("n_Shots").text.sourceText);if(b == 0){
c = "No shots taken";
} else {
c=Math.round((a/b*100))+"%";
}
