In After Effects, I am trying to programmatically generate numbers that count up. But when the numbers start counting up, it is pushing the units to the right.

How I can make units position fixed (right aligned)?

Here is the code I'm using:

startT = 0;
endT = 8;
beginVal = 143;
endVal = 50143;
t =Math.round(linear(time,startT,endT,beginVal,endVal));
t += "";
t.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1 ");

Not sure if this is what you mean, but can't you just set your text object to Align right in the Paragraph tab? So all the text is right aligned. That way the units won't jump around.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.