Hi everyone! If you’ve stumbled upon this post and found the previous expressions don;t work then use this modified one. There was a slight typo in the last post which breaks the expression.
nums= PICKWHIP VALUE ;
amtOfZeroes= 10 ;
numOfDecimals= 3 ;
//------------------------------------------------------------ ;
nums = nums.value.toFixed(numOfDecimals);
isNeg = false;
if (nums < 0)
{
nums = Math.abs(nums);
nums = nums.toFixed(numOfDecimals);
isNeg = true;
}
numsArray = nums.split(".");
numsFloat = numsArray[0];
while (numsFloat.length < amtOfZeroes)
{
numsFloat = "0" + numsFloat;
}
if(isNeg)
{
numsFloat = "-" + "0" + numsFloat;
}
numsFloat + "." + numsArray[1]