This example will ramp from the number in layer “Text 1” to the number in layer “Text 2” (both formatted with commas) over the period defined by variable dur, starting at the time defined by variable tStart and format the result with commas:
dur = 5;
txt1 = thisComp.layer("Text 1").text.sourceText;
n1 = parseFloat(txt1.replace(/,/g, ''));
txt2 = thisComp.layer("Text 2").text.sourceText;
n2 = parseFloat(txt2.replace(/,/g, ''));
tStart = inPoint;
tEnd = tStart + dur;
n = linear(time,tStart,tEnd,n1,n2);
parseInt(n,10).toLocaleString()