Percentage on lavel
-
Im trying to put percentage value from knob to label.
But I can't convert value to percentage, how I can convert 0.00 to 0%? I tried JS solutions but without success -
parseInt()
is what you‘re looking for. -
@Christoph-Hart im not sure what im doin wrong
inline function onsaturationControl(component, value) { local v = saturationKnob.getValue(); Content.setPropertiesFromJSON("saturationLabel", { "text": parseInt(v), }); }; Content.getComponent("saturation").setControlCallback(onsaturationControl);
But I get only 0 or 1 on max
-
parseInt(v * 100)
. Normalised percentage means that the range is from 0 to 1. -
@Christoph-Hart thanks!