-
Number counter
I’m looking for a workflow that will allow me to use several text boxes for 1 counter, so that the string all works together.
I have this expression, however I can’t get it to work over several text boxes.
var num = effect(“Slider Control”)(“Slider”); num = Comma(num);
function Comma(number) { number = “$”+ ” + Math.round(number); if (number.length > 3) { var mod = number.length % 3; var output = (mod > 0 ? (number.substring(0,mod)) : ”); for (i=0 ; i < Math.floor(number.length / 3); i++) { if ((mod == 0) && (i == 0)) output += number.substring(mod+ 3 * i, mod + 3 * i + 3); else output+= ‘,’ + number.substring(mod + 3 * i, mod + 3 * i + 3); } return (output); } else return number; }
Is there another workflow or something I’m missing. The reason I want to do this is that the font jumps around too much as the numbers aren’t mono spaced.