ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Re: Expression to detect text or number

COW Forums : Adobe After Effects Expressions

FAQ   •   VIEW ALL   •   ADD A NEW POST   •   PRINT
Respond to this post   •   Return to posts index   •   Read entire thread


Dan Ebberts
Re: Expression to detect text or number
on Jan 24, 2020 at 8:09:49 pm

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:

n = parseFloat(yourText);
if (isNaN(n)) n = 0;
n


Dan



Posts IndexRead Thread 


Current Message Thread:





© 2020 CreativeCOW.net All Rights Reserved
[TOP]