<p>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.</p>

CC BY-SA 3.0
2016-11-22T21:07:21.657Z
2016-11-22T21:07:21.657Z
tomh
<p>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.</p>

<p>How I can make units position fixed (right aligned)?</p>

<p>Here is the code I'm using:</p>

<pre><code>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 ");
</code></pre>

<after-effects>
Generating numbers counting up with fix poisition for units
Sergio santa
# Generating numbers counting up with fix poisition for units

(Asked by: username_0 on 2016-11-22)

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 ");

**Tags:** after-effects


---

## 1 answers

### Answer by username_1 on 2016-11-22. Score: 1 | Accepted answer

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.


---

