Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Stumped on text expression

  • Stumped on text expression

    Posted by Aaron Magee on July 7, 2010 at 2:42 pm

    So let me try and explain my problem clearly.

    I have a number value that’s counting up past 25,000.

    The value is controlled by a slider that has a Math.floor command on it to keep the value in integer format.

    The problem is that I need to have the comma appear when the values are in the thousands. Right now the numbers are just in whole number formats.

    Does this make any sense to anyone? Hopefully I’ve expained myself clearly enough.

    Thanks-

    Aaron

    Dan Ebberts replied 16 years, 2 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    July 7, 2010 at 3:54 pm

    Try this:

    s = “” + Math.floor(effect(“Slider Control”)(“Slider”));
    n = s.length;
    if (n > 3)
    s.substr(0,n-3) + “,” + s.substr(-3)
    else
    s

    Dan

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