CC

CG study (After Effects, Nuke, Maya...), English study and more.

Monday, September 28, 2009

[After Effects]-random number expression

Add expression to Text Layer's property, "Source Text".

random(10,15).toFixed(2)
=returns random number from 10 to 15, formats the number to 2 decimals.

quote;
Number.toFixed(x)
Formats any number for "x" number of trailing decimals. The number is rounded up, and "0"s are used after the decimal point if needed to create the desired decimal length.







Math.round(random(10,15))

=returns random number from 10 to 15, round decimal fraction

quote;
Math.round(x)
Using it, any supplied argument is rounded off to the nearest integer, and using the ".5" up rule.




No comments:

Post a Comment