I appreciate I'm late to the party here as this is a few years old but I wanted to say
thanks to @Bryan Ray as the solution was perfect for me.
I had this originally to count seconds on my clip
floor(time/comp:GetPrefs("Comp.FrameFormat.Rate"))however then I decided I wanted to have decimal places but the above was limited to the zero decimal places. Using the expression you shared I entered
Text( string.format("%.5f", floor(time/comp:GetPrefs("Comp.FrameFormat.Rate"))))replacing the [number source] with what I would have as the number source. I then realised that this would just produce 1.00, 2.00, 3.00 and so on and then realised I needed to remove the floor so all the decimals came into the input so the string.format could take it to two
making the final expression
Text( string.format("%.2f", time/comp:GetPrefs("Comp.FrameFormat.Rate"))) Thank you!!!