From my understanding, this may be what you're looking for. Use this instead of your existing code. Doesn't deal with the negative sign, though; written hastily. In the morning I'll double check it and refine it to add the negative!
I am linking one layers rotation to a text layers source text.
How do I modify the simple expression to limit the decimal to two places, and at the same time make all integers two digits so 0 - 9 are 00, 01, 02,...?
Something like this but that adds two decimal places to the number:
//--Expression begins
nums = thisComp.layer("shape").transform.rotation;
amtOfZeroes = 2;
//--Do not modify below this line
isNeg = false;
if(nums < 0)
{
nums = Math.abs( nums );
isNeg = true;
}
sVal = Math.round( nums ) + "";
while(sVal.length < amtOfZeroes)
{
sVal = "0" + sVal;
}
if(isNeg)
sVal = "-" + sVal;
sVal
//--Expression ends
Thanks, James
+---End of message---+
To unsubscribe send any message to <
ae-list-off@media-motion.tv>