Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Counting using a slider but adding a word after the numbers..

  • Counting using a slider but adding a word after the numbers..

    Posted by Alex Dinnin on October 9, 2014 at 2:22 pm

    Basically..

    I need to create an expression that adds a word onto the end of a counting number

    I need it to go from 0 to 100 “MILLION” the text stays the same it’s just added onto the line

    so it counts 1 MILLION, 2 MILLION 3 MILLION etc etc

    So I’m using this expression for my counting numbers

    val = effect(“ZEROES”)(“Slider”);
    numDec = 0; // digits to right of decimal
    numDigit = 0; // digits to left of decimal
    if (val < 0) sign = “-” else sign = “”; s = Math.abs(val).toFixed(numDec); while (s.length < numDigit + numDec + 1) s = “0” + s; sign + s

    I just need to add the word MILLION at the end… is this possible ?? I can’t use a seperate layer as I have some crazy other expressions linking to this text layer ?

    Any ideas..

    thanks as always

    Alex

    Alex Dinnin replied 11 years, 9 months ago 1 Member · 1 Reply
  • 1 Reply
  • Alex Dinnin

    October 9, 2014 at 2:30 pm

    I found something Dan had supplied earlier.. I’ve looked for blooming hours before resorting to asking for help..

    then as soon as I hit post.. I find this about ten seconds laters..

    s = Math.round(effect(“ZEROES”)(“Slider”)).toString();
    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i–){
      outStr += “,” + s.substr(-i*3,3);
    }
    outStr + ” MILLION”;

    Thanks for reading

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy