Could you please explain how would I calculate the values below the slider?
Is the “percentage cost” = “Food Cost” / “Price Less Cost”? If so, then, wouldn’t the percentage keep dropping as the “Price Less Cost keeps” increasing?
Regards
Edit: And what is the max value that the slider can go up to?
Hi! The trick is to take the fraction of the slider handle’s position between the beginning and end of the slider (e.g. 0.5 would be halfway) and multiply this by the maximum value of the slider.
You can calculate this as follows, assuming you put the script in the dragged slider handle (which is the “This” in the expression below), and that LVAR_back is a local variable referring to the slider’s track object (named Background in your file). The following assumes your slider goes to 100
Set text on (whatever) to [[ (This.left - LVAR_back.left)/(LVAR_back.width - This.width) * 100]]
You’ll probably want to round this to a certain number of decimal places, so…