Hi @José Mario Valdeolivar Acosta,
To display values such as "fMax" and "fMin" in the labels (as shown in the screenshot) first there is a need to convert these numeric values into strings. This can be done using the “sprintf()’ function. Once you have converted the numbers to text, simply assign this string to the label’s “Text” property.
Here is the step-by-step process:
- First you need to identify the labels. This can be done by checking out the names in the Component Browser in App Designer.
- After calculating “fMin” and “fMax”, convert the numeric values to string values and assign them to the labels in this way:
app.MaxLabel.Text = sprintf('Max: (%.2f, %.2f)', xMax, fMax);
app.MinLabel.Text = sprintf('Min: (%.2f, %.2f)', xMin, fMin);
The numerical display precision can be adjusted by modifying the format specifier within the “sprintf()” function. For example, altering the value in '%.2f' changes the number of decimal places to two places.
Please refer to the documentations for more details:
Hope this helps.