Hey Dan,
I used a “counter with slider” expression I believe you wrote a while back to hook up the text value to the slider so I could round off the decimals and use the prefix MPH. Where would you add the “convertSpeed” linear function to that expression? Or am I going about this wrong?
slider = thisComp.layer("Speed Control").effect("Speed")("Slider");
numDecimals = 0;
commas = false;
dollarSign = false;
percentSign = false;
s = slider.value.toFixed(numDecimals);
prefix = "";
suffix = "MPH";
if (s[0] == "-"){
prefix = "-";
s = s.substr(1);
}
if(dollarSign) prefix += "$";
if(percentSign) suffix = "%";
if (commas){
decimals = "";
if (numDecimals > 0){
decimals = s.substr(-(numDecimals + 1));
s = s.substr(0,s.length - (numDecimals + 1));
}
outStr = s.substr(-s.length, (s.length-1)%3 +1);
for (i = Math.floor((s.length-1)/3); i > 0; i--){
outStr += "," + s.substr(-i*3,3);
}
prefix + outStr + decimals + suffix;
}else{
prefix + s + suffix;
}
Jason Jantzen
vimeo.com/jasonj