setVar() decimals


I'd like to display some fader widget value to a text object in my matrix of channel strip fragment.

I've found out how to do this by using "value": "VAR{level,100}" in text widget and "onValue": "setVar(\"faderValue_@{parent.variables.n}\",\"level\",get(this))" in fader widget with "decimals": 0.

This works pretty well but the number displayed in text widget has decimal numbers, and this is not what I've been expecting.

This is strange because the fader send an integer value through OSC, as expected.

I've tried the Math.floor(get(this)) function but it displays the OSC value minus 1, and Math.ceil(get(this)) displays the OSC value plus 1, so weird...

Maybe I've made this too complicated, but it's the only way I've found to display value through a fragment matrix generated by a custom module.

Setting the text widget's decimal property to 0 will do.

Pro tips : don't use @{} in scripting properties (see warning) and use value instead of get(this) in onValue:

setVar('faderVarlue_' + getProp('parent', 'variables').n, 'level', value)

That did the trick, so this is not a bug.

I've forgot the warning because this is coded into the json file from a text editor.

Thank for the fast answer.