I'm working on making an AE template that imports data from a text file. Some fields are text and others are numbers and I have them linked to different text layers and expression controls in my project. This text file will be shared with multiple people and I'm trying to make it so if they accidentally enter a text string where a number is supposed to be, rather than popping up the expression error, it will assign the value as a 0.
Is there an expression to check if the value is a text string or number?
If you're using a text file, the numbers start out as text, correct? So (I.m guessing) your expression must be using parseInt() or parseFloat() to convert the text to a number. If so, you can use isNaN() after the conversion to see if it actually created a number. Like this: