|
|
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
|
|