-
Extra decimal places using math.floor expression
Hey everyone, I’ve got an expression that I am using which converts a degree of rotation (0-180) into a percentage of blood alcohol content (.01-.40). I’ve got everything functionally working, my only problem is that when it reaches a whole number – .3 – I’m losing the ‘0’ that I want to display after the ‘3’ – making it .30. Is there any modification I can make that will allow that extra 0 to display – even though mathematically it’s irrelevant? My expression is below.
The value that the math.floor part is modifying is the degree of rotation of a needle on a gauge – any value between 0 degrees and 180 degrees. I may have overcomplicated the whole expression but any advice is greatly appreciated. Thanks!
(Math.floor(((thisComp.layer("needle wiggle").transform.rotation)/4.5)))*.01