![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532954/image.png)
Displaying an integer value in a numeric edit field in App Designer
29 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Joshua Mitchell
il 26 Feb 2021
Commentato: Cris LaPierre
il 1 Mar 2021
I am trying to make an edit field display an integer value instead of using scientific notation. I would like to do it in a Value Changed Function after the code seen here:
% Value changed function: AmbientFieldEditField
function AmbientFieldEditFieldValueChanged(app, event)
value1 = app.AmbientFieldEditField.Value;
app.Ba_mag = value1;
I have tried a few things with no success such as:
int8(round(app.AmbientFieldEditField.Value,0));
I am not sure if I am even on the right track. I will also eventually need to apply the same change to the Z-axis of a 3D plot.
The edit field:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532944/image.png)
Any help is appreciated, thanks!
0 Commenti
Risposta accettata
Cris LaPierre
il 26 Feb 2021
This is related to the display format. In the property inspector, loof for the ValueDisplayFormat property. The default is $11.4g. Change it to %g.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/532954/image.png)
You can also set this programmatically.
app.AmbientFieldEditField.ValueDisplayFormat - '%g';
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Axes Appearance in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!