Hi,
I’ve been playing with the “new to me” label parameter of the Slider COMP trying to get it to display the slider’s current value. While this worked on the first attempt:
'VALUE: ' + str(me.par.value0)
This resulted in an error when I tried to round the value to two decimals:
'VALUE ' + str( round( me.par.value0, 2) )
TypeError: type td.Par doesn't define __round__ method
I had to explicitely cast the slider’s value0 parameter to a float in order for the second argument of the round method to be taken into account:
'VALUE ' + str( round( float(me.par.value0), 2)
I understand that value0’s type is in fact td.Par while the round method is probably expecting a float but why is the cast not necessary in the first case but required in the second?
Thanks!