Generating numbers counting up with fix poisition for units 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.