Appdesigner Numeric Edit Field value is displayed different when user tries to edit
Show older comments
When the value of a numeric field edited by a function (we can assume a basic divide pi/exp(1) as the value), it displays the value as the ValueDisplayFormat identifies (in my application, 4 digit fraction (%.4f) like 1.1557). However, when user tries to edit this value, numeric field shows around 15 digits, even the value is rounded to 4th digit which makes editing values by user very hard due to all this digits. Is there a better way to implement such a feature using a different data type maybe (because I think problem arises from double cannot exactly is roundable to fractions) to not change number of digits in the fraction when user tries to edit it?
Answers (1)
Mario Malic
on 8 Sep 2023
0 votes
Hi,
Just use round function on the user input, Event.NewData IIRC.
5 Comments
Tek
on 8 Sep 2023
Mario Malic
on 8 Sep 2023
Yes, sorry for not being clear. What is the issue exactly here? What happens during the user edit of the component?
In the ValueChangedCallback, user data will be in the Event.Value.
Tek
on 12 Sep 2023
Mario Malic
on 12 Sep 2023
Make a minimal example and upload it so I can check it.
Tek
on 11 Oct 2023
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!