Activity › Forums › Adobe After Effects › Numbers or text expression with a ,
-
Numbers or text expression with a ,
Dustin Ward replied 14 years, 12 months ago 5 Members · 15 Replies
-
Tom Mont
June 13, 2006 at 6:59 pmPlease refer to
https://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=2&postid=880527
Somehow the posts got mixed up.. i still having problems -
Filip Vandueren
June 13, 2006 at 7:50 pmthe Slider Control can not be set beyond -1 and +1 million, the script still works though.
You can get around it by using a Point Control Instead of a Slider, you only need the first value, so create a Point Control and change the first line to something like:
num=effect(“Point Control”)(“Point”)[0];
(this assumes the Point Control is actually asigned to the Text-layer itself. You can just pickwhip to the first number of the Point’s co
-
Filip Vandueren
June 13, 2006 at 8:00 pmI also fixed a bug were -xxxxxx would display as -,xxx,xxx:
num=effect("Point Control")("Point")[0]; // use the first part of a point for more resolution than a slidernumAsText= ""+num;
dotIndex = numAsText.indexOf("."); // check for decimals
if (dotIndex==-1) { dotIndex=numAsText.length; }formattedText = numAsText.substring(dotIndex-3,dotIndex+3); // +4 for 3 decimals etc.
if (dotIndex>3) {
for (i=dotIndex-3 ; i>0 ; i=i-3) {
extractedText = numAsText.substring(i-3,i);
if (extractedText=="-") {
formattedText = extractedText + formattedText
} else {
formattedText = extractedText + "," + formattedText
}
}
}formattedText;
Reply to this Discussion! Login or Sign Up